package
Version:
v0.22.3
Opens a new window with list of versions in this module.
Published: Jan 16, 2025
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Buffer is a simple implementation of a ring/circular buffer.
func NewBuffer(size uint) *Buffer
NewBuffer returns a ring buffer of a given size.
func (b *Buffer) Close() error
func (b *Buffer) Len() int
func (b *Buffer) Read(p []byte) (int, error)
Read reads from the buffer, returning io.EOF if it has read up until where
it has written.
func (b *Buffer) Write(p []byte) (int, error)
Write writes to the buffer, circularly overwriting data if p exceeds the
size of the buffer.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.