Documentation ¶
Index ¶
- Variables
- type RingBuffer
- func (r *RingBuffer) Append(b []byte) (int, error)
- func (r *RingBuffer) AvailableBuffer() []byte
- func (r *RingBuffer) Cap() int
- func (r *RingBuffer) Consume(count int)
- func (r *RingBuffer) Fetch(b []byte, off int) int
- func (r *RingBuffer) Free() int
- func (r *RingBuffer) Len() int
- func (r *RingBuffer) Peek(off int) []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBufferFull = errors.New("ringbuffer: buffer full")
)
Functions ¶
This section is empty.
Types ¶
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
RingBuffer is an unsynchronized ring buffer. Any concurrent use MUST be externally synchronized.
func NewRingBuffer ¶
func NewRingBuffer(buf []byte) *RingBuffer
func (*RingBuffer) AvailableBuffer ¶
func (r *RingBuffer) AvailableBuffer() []byte
func (*RingBuffer) Cap ¶
func (r *RingBuffer) Cap() int
func (*RingBuffer) Consume ¶
func (r *RingBuffer) Consume(count int)
func (*RingBuffer) Free ¶
func (r *RingBuffer) Free() int
func (*RingBuffer) Len ¶
func (r *RingBuffer) Len() int
func (*RingBuffer) Peek ¶
func (r *RingBuffer) Peek(off int) []byte
Click to show internal directories.
Click to hide internal directories.