Documentation
¶
Index ¶
- type MessageBuffer
- func (mb *MessageBuffer) AddCell(r *RingCell)
- func (mb *MessageBuffer) EraseCell()
- func (mb *MessageBuffer) GetCurrent() (*RingCell, *ring.Ring, bool)
- func (mb *MessageBuffer) GetNewestCell() (*RingCell, *ring.Ring, bool)
- func (mb *MessageBuffer) GetOldestCell() (*RingCell, *ring.Ring, bool)
- func (mb *MessageBuffer) SetCurrent(r *ring.Ring)
- type RingCell
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageBuffer ¶
type MessageBuffer struct {
// contains filtered or unexported fields
}
MessageBuffer wraps ring.Ring for creating ring buffer
func NewMessageBuffer ¶
func NewMessageBuffer(n int) *MessageBuffer
NewMessageBuffer creates new instance of MessageBuffer with n buffer length
func (*MessageBuffer) AddCell ¶
func (mb *MessageBuffer) AddCell(r *RingCell)
AddCell writes value to the ring item after Current it may rewrite existing ring item value
func (*MessageBuffer) EraseCell ¶
func (mb *MessageBuffer) EraseCell()
EraseCell deletes value from current ring item and sets Current to previous
func (*MessageBuffer) GetCurrent ¶
func (mb *MessageBuffer) GetCurrent() (*RingCell, *ring.Ring, bool)
GetCurrent gets current ring cell Value, pointer to current cell and bool that indicates if Value was not nil
func (*MessageBuffer) GetNewestCell ¶
func (mb *MessageBuffer) GetNewestCell() (*RingCell, *ring.Ring, bool)
GetNewestCell returns newest (by timestamp) ring value, pointer to current ring item and true if (non-nil) value was found; returns false otherwise; mostly for debug purposes
func (*MessageBuffer) GetOldestCell ¶
func (mb *MessageBuffer) GetOldestCell() (*RingCell, *ring.Ring, bool)
GetOldestCell returns newest (by timestamp) ring value, pointer to current ring item and true if value was found; returns false otherwise; mostly for debug purposes
func (*MessageBuffer) SetCurrent ¶
func (mb *MessageBuffer) SetCurrent(r *ring.Ring)
SetCurrent sets ring current position