Documentation ¶
Overview ¶
Code generated by ring-buffer-gen. DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
Ring buffer for type Record
func WrapRingBuffer ¶
func WrapRingBuffer(buffer []stats.Record) *RingBuffer
Wrap pre-allocated buffer to ring buffer
func (*RingBuffer) Add ¶
func (rb *RingBuffer) Add(value stats.Record)
Add new element to the ring buffer. If buffer is full, the oldest element will be overwritten
func (*RingBuffer) Clone ¶
func (rb *RingBuffer) Clone() *RingBuffer
Clone of ring buffer with shallow copy of underlying buffer
func (*RingBuffer) Flatten ¶
func (rb *RingBuffer) Flatten() []stats.Record
Flatten copy of underlying buffer. Data is always ordered in an insertion order
func (*RingBuffer) Get ¶
func (rb *RingBuffer) Get(index int) (ans stats.Record)
Get element by index. Negative index is counting from end
func (*RingBuffer) Len ¶
func (rb *RingBuffer) Len() int
Length of used elements. Always in range between zero and maximum capacity
Click to show internal directories.
Click to hide internal directories.