ring

package
v0.0.0-...-bdc7756 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRingLenNotEnough = errors.New("ring has not enough items for pop n")
	ErrRingCapNotEnough = errors.New("ring has not enough space for push n")
)

Functions

This section is empty.

Types

type Ring

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

func NewRing

func NewRing(maxSize int) *Ring

func (*Ring) Cap

func (r *Ring) Cap() int

func (*Ring) Empty

func (r *Ring) Empty() bool

func (*Ring) Full

func (r *Ring) Full() bool

func (*Ring) Get

func (r *Ring) Get() interface{}

func (*Ring) GetAll

func (r *Ring) GetAll() []interface{}

func (*Ring) Gets

func (r *Ring) Gets(n int) []interface{}

func (*Ring) Len

func (r *Ring) Len() int

func (*Ring) MPop

func (r *Ring) MPop(n int) ([]interface{}, error)

func (*Ring) MPush

func (r *Ring) MPush(items []interface{}) error

func (*Ring) Pop

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

func (*Ring) Push

func (r *Ring) Push(item interface{}) error

Jump to

Keyboard shortcuts

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