Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer[T any] struct { // contains filtered or unexported fields }
Buffer is a non-thread-safe ring (circular) buffer.
Notes: - Capacity is the maximum number of elements it can hold. - Internally it keeps one slot empty to distinguish full vs empty. - This is intended as a low-level primitive; add locking externally if needed.
type ByteBuffer ¶
type ByteBuffer struct {
// contains filtered or unexported fields
}
ByteBuffer is a ring buffer specialized for bytes.
Semantics match Buffer[T]: it keeps one slot empty internally.
func NewBytes ¶
func NewBytes(capacity int) *ByteBuffer
func (*ByteBuffer) Cap ¶
func (b *ByteBuffer) Cap() int
func (*ByteBuffer) Len ¶
func (b *ByteBuffer) Len() int
func (*ByteBuffer) Read ¶
func (b *ByteBuffer) Read(p []byte) int
Read reads up to len(p) bytes and returns the number of bytes read.
func (*ByteBuffer) Reset ¶
func (b *ByteBuffer) Reset()
func (*ByteBuffer) Space ¶
func (b *ByteBuffer) Space() int
func (*ByteBuffer) Write ¶
func (b *ByteBuffer) Write(p []byte) int
Write writes as many bytes as possible and returns the number of bytes written.
Click to show internal directories.
Click to hide internal directories.