buffer

package
Version: v0.0.0-...-6203023 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 0 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingGrowing

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

RingGrowing is a growing ring buffer. Not thread safe.

func NewRingGrowing

func NewRingGrowing(initialSize int) *RingGrowing

NewRingGrowing constructs a new RingGrowing instance with provided parameters.

func (*RingGrowing) ReadOne

func (r *RingGrowing) ReadOne() (data interface{}, ok bool)

ReadOne reads (consumes) first item from the buffer if it is available, otherwise returns false.

func (*RingGrowing) WriteOne

func (r *RingGrowing) WriteOne(data interface{})

WriteOne adds an item to the end of the buffer, growing it if it is full.

Source Files

Jump to

Keyboard shortcuts

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