ringbuffer

package
v4.16.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ringbuffer contains a ring buffer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingBuffer

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

RingBuffer is a ring buffer.

func New

func New(size uint64) (*RingBuffer, error)

New allocates a RingBuffer.

func (*RingBuffer) Close

func (r *RingBuffer) Close()

Close makes Pull() return false.

func (*RingBuffer) Pull

func (r *RingBuffer) Pull() (interface{}, bool)

Pull pulls data from the beginning of the buffer.

func (*RingBuffer) Push

func (r *RingBuffer) Push(data interface{}) bool

Push pushes data at the end of the buffer.

func (*RingBuffer) Reset

func (r *RingBuffer) Reset()

Reset restores Pull() behavior after a Close().

Jump to

Keyboard shortcuts

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