ringbuf

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSize = 4096

Variables

View Source
var ErrBufferEmpty = fmt.Errorf("ringbuf: buffer empty")

Functions

This section is empty.

Types

type RingBuffer

type RingBuffer struct {
	// contains filtered or unexported fields
}

func New

func New(r io.Reader, n int) *RingBuffer

func (*RingBuffer) AdvanceRead

func (rb *RingBuffer) AdvanceRead(n int)

func (*RingBuffer) Cap

func (rb *RingBuffer) Cap() int

func (*RingBuffer) Fill

func (rb *RingBuffer) Fill() (n int64, err error)

func (*RingBuffer) Len

func (rb *RingBuffer) Len() int

func (*RingBuffer) Peek

func (rb *RingBuffer) Peek(n int) (bytes []byte, err error)

func (*RingBuffer) PeekReadable

func (rb *RingBuffer) PeekReadable() (rs Slice)

func (*RingBuffer) PeekUptoAndIncluding

func (rb *RingBuffer) PeekUptoAndIncluding(b byte) (readable Slice, err error)

func (*RingBuffer) PeekWriteable

func (rb *RingBuffer) PeekWriteable() (rs Slice)

func (*RingBuffer) Read

func (rb *RingBuffer) Read(p []byte) (n int, err error)

func (*RingBuffer) ReadLength

func (rb *RingBuffer) ReadLength() int64

func (*RingBuffer) Reset

func (rb *RingBuffer) Reset(r io.Reader)

func (*RingBuffer) Write

func (rb *RingBuffer) Write(p []byte) (n int, err error)

type Slice

type Slice struct {
	// contains filtered or unexported fields
}

func (Slice) Bytes

func (rs Slice) Bytes() []byte

func (Slice) Equal

func (rs Slice) Equal(b []byte) bool

func (Slice) First

func (rs Slice) First() []byte

func (Slice) FirstByte

func (rs Slice) FirstByte() byte

func (Slice) HasPrefix

func (rs Slice) HasPrefix(prefix []byte) bool

func (Slice) IsEmpty

func (rs Slice) IsEmpty() bool

func (Slice) Len

func (rs Slice) Len() int

func (Slice) LenFirst

func (rs Slice) LenFirst() int

func (Slice) LenSecond

func (rs Slice) LenSecond() int

func (Slice) Overlap

func (rs Slice) Overlap() (o [6]byte, first, second int)

func (Slice) ReadFrom

func (rs Slice) ReadFrom(r io.Reader) (n int64, err error)

func (Slice) Second

func (rs Slice) Second() []byte

func (Slice) Slice

func (rs Slice) Slice(left, right int) (b Slice)

func (Slice) SliceUptoAndIncluding

func (rs Slice) SliceUptoAndIncluding(b byte) (s Slice, ok bool)

func (Slice) SliceUptoButExcluding

func (rs Slice) SliceUptoButExcluding(b byte) (s Slice, ok bool)

func (Slice) Start

func (rs Slice) Start() int64

func (Slice) String

func (rs Slice) String() string

func (Slice) WriteTo

func (rs Slice) WriteTo(w io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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