ringbuffer

package
v0.0.0-...-77610c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2024 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

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) Append

func (r *RingBuffer) Append(b []byte) (int, error)

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) Fetch

func (r *RingBuffer) Fetch(b []byte, off int) 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL