buffer

package
v0.3.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBufferFull  = errors.New("the ring buffer is full")
	ErrBufferEmpty = errors.New("the ring buffer is empty")
)

Functions

This section is empty.

Types

type RingBuffer

type RingBuffer struct {
	// contains filtered or unexported fields
}

func NewRingBuffer

func NewRingBuffer(size int64) *RingBuffer

func (*RingBuffer) Dequeue

func (rb *RingBuffer) Dequeue() (any, error)

func (*RingBuffer) Enqueue

func (rb *RingBuffer) Enqueue(item any) error

func (*RingBuffer) IsEmpty

func (rb *RingBuffer) IsEmpty(val int64) bool

func (*RingBuffer) IsFull

func (rb *RingBuffer) IsFull(val int64) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL