Documentation ¶ Index ¶ Variables type RingBuffer func New[T any](capacity int) RingBuffer[T] Constants ¶ This section is empty. Variables ¶ View Source var ( // ErrIsEmpty indicate ring buffer is empty. ErrIsEmpty = errors.New("ring buffer is empty") // ErrIsFull indicate ring buffer is full. ErrIsFull = errors.New("ring buffer is full") ) Functions ¶ This section is empty. Types ¶ type RingBuffer ¶ type RingBuffer[T any] interface { Enqueue(T) error Dequeue() (T, error) Peak() (T, error) Length() int Capacity() int } RingBuffer is an interface. func New ¶ func New[T any](capacity int) RingBuffer[T] NewSpscRingBuffer return the spsc ring buffer with specified capacity. Source Files ¶ View all Source files ring_buffer.gospsc_ring_buffer.go Click to show internal directories. Click to hide internal directories.