circbuf

package
v0.8.13 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

Buffer represents a dynamic circular (ring) buffer. It will append data freely to the underlying buffer until maxSize is hit. Once hit, new writes will be written in a circular fashion.

func NewBuffer

func NewBuffer(maxSize int) (*Buffer, error)

NewBuffer creates and returns a Buffer pointer with a max size.

func (*Buffer) Bytes

func (c *Buffer) Bytes() []byte

func (*Buffer) Size

func (c *Buffer) Size() int

func (*Buffer) TotalWritten

func (c *Buffer) TotalWritten() int

func (*Buffer) Write

func (c *Buffer) Write(buf []byte) (int, error)

Write implements io.Writer.

Jump to

Keyboard shortcuts

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