ring

package
v0.0.0-...-bda352f Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntRing

type IntRing struct {
	Items      []int
	CurrentIdx int
}

Provides a ring buffer of integers with a lightweight interface.

func New

func New(size int) IntRing

Returns an IntRing with a given size.

func (*IntRing) Push

func (r *IntRing) Push(item int)

Push(item) adds the given item as the most recent item overwriting the oldest item.

Jump to

Keyboard shortcuts

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