ringbuffer

package
v0.20.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-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 is a simple implementation of a ring/circular buffer.

func NewBuffer

func NewBuffer(size uint) *Buffer

NewBuffer returns a ring buffer of a given size.

func (*Buffer) Close

func (b *Buffer) Close() error

func (*Buffer) Len

func (b *Buffer) Len() int

func (*Buffer) Read

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 (*Buffer) Write

func (b *Buffer) Write(p []byte) (int, error)

Write writes to the buffer, circularly overwriting data if p exceeds the size of the buffer.

Jump to

Keyboard shortcuts

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