ring

package
v0.0.0-...-b671e6f Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ring

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

Ring container with fixed capacity

func New

func New(capacity ...int) *Ring

New return Ring conatiner with capacity Default capacity is 10

func (*Ring) Pop

func (t *Ring) Pop() (interface{}, error)

Pop return interfaces, error If there are no elements in Ring, return error

func (*Ring) Push

func (t *Ring) Push(args interface{}) error

Push return error if elements exceed capacity Push args into Ring

func (*Ring) Size

func (t *Ring) Size() int

Size return number of elements

Jump to

Keyboard shortcuts

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