Documentation ¶
Index ¶
Constants ¶
View Source
const BufferSize uint32 = 5000
BufferSize the default size for the Ring Buffer
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RingBuffer ¶
RingBuffer data structure
func (*RingBuffer) Get ¶
func (r *RingBuffer) Get() *interface{}
Get returns the elements in FIFO manner or nil if buffer is empty.
func (*RingBuffer) PrintDetails ¶
func (r *RingBuffer) PrintDetails()
PrintDetails diplays details for debugging purpose.
func (*RingBuffer) Put ¶
func (r *RingBuffer) Put(inp interface{}) bool
Put adds the item into buffer if there is room in buffer. Returns true if item is buffered otherwise false.
func (*RingBuffer) ReadN ¶
func (r *RingBuffer) ReadN(n uint32) ([]*interface{}, uint32)
ReadN reads the next n available elements in the buffer. Returns elements and number of elements read.
func (*RingBuffer) RemoveN ¶
func (r *RingBuffer) RemoveN(n uint32)
RemoveN removes the first n elements from the buffer.
Click to show internal directories.
Click to hide internal directories.