code: func NewCircularBuffer(ctx context.Context, size int) (*CircularBuffer, error) {
  	if size <= 0 {
  		return nil, trace.BadParameter("circular buffer size should be > 0")
  	}
  	ctx, cancel := context.WithCancel(ctx)
  	buf := &CircularBuffer{
  		Entry: log.WithFields(log.Fields{
  			trace.Component: teleport.ComponentBuffer,
  		}),
  		ctx:      ctx,
  		cancel:   cancel,
  		events:   make([]Event, size),
  		start:    -1,
  		end:      -1,
  		size:     0,
  		watchers: newWatcherTree(),
  	}
  	return buf, nil
  }
docs: // NewCircularBuffer returns a new instance of circular buffer