Documentation
¶
Overview ¶
Package circular implements a circular buffer
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyBuffer = errors.New("circular : Attempted to read from an empty buffer")
ErrEmptyBuffer is thrown when we try to read from a fallow buffer
View Source
var ErrFullBuffer = errors.New("circular : Attempted to write to a full buffer")
ErrFullBuffer is thrown when we try to write to a buffer at capacity
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer implements a bounded, circular buffer
func (*Buffer) Overwrite ¶
Overwrite attempts to write normally, but if that's not possible, overwrites the oldest data we have
func (*Buffer) ReadByte ¶
ReadByte gives back the next byte in the circular buffer and increments our read head if possible
Click to show internal directories.
Click to hide internal directories.