Documentation
¶
Index ¶
- type RingBuffer
- func (rb *RingBuffer) Capacity() int
- func (rb *RingBuffer) Clear()
- func (rb *RingBuffer) IsEmpty() bool
- func (rb *RingBuffer) IsFull() bool
- func (rb *RingBuffer) Occupied() int
- func (rb *RingBuffer) Pop() (interface{}, error)
- func (rb *RingBuffer) PopMany(number uint) ([]interface{}, error)
- func (rb *RingBuffer) Push(elements ...interface{}) error
- func (rb *RingBuffer) Remaining() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
func (*RingBuffer) Capacity ¶
func (rb *RingBuffer) Capacity() int
Returns the capacity of the RingBuffer
func (*RingBuffer) IsEmpty ¶
func (rb *RingBuffer) IsEmpty() bool
Checks if the RingBuffer ist empty
func (*RingBuffer) Occupied ¶
func (rb *RingBuffer) Occupied() int
Returns the occupied capacity of the RingBuffer
func (*RingBuffer) Pop ¶
func (rb *RingBuffer) Pop() (interface{}, error)
Returns the oldest element of the RingBuffer
func (*RingBuffer) PopMany ¶
func (rb *RingBuffer) PopMany(number uint) ([]interface{}, error)
Returns a given number(n) of elements of the RingBuffer starting with the oldest one
func (*RingBuffer) Push ¶
func (rb *RingBuffer) Push(elements ...interface{}) error
Pushes one or more elements to the Ringbuffer
func (*RingBuffer) Remaining ¶
func (rb *RingBuffer) Remaining() int
Returns the remaining capacity of the RingBuffer
Click to show internal directories.
Click to hide internal directories.