queue

package
v0.0.0-...-a807e99 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(uid string)

Delete removes value from queue.

func GetByID

func GetByID(uid string) interface{}

GetByID returns element from Queue by uid.

func GetFirst

func GetFirst() interface{}

GetFirst returns first element from Queue.

func GetLast

func GetLast() interface{}

GetLast returns last element from Queue.

func IsInQueue

func IsInQueue(uid string) bool

IsInQueue checks is element with given uid in Queue.

func Put

func Put(uid string, data interface{})

Put adds value to queue.

Types

type Queue

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

Queue is a simple concurrency-safe FIFO implementation.

func NewQueue

func NewQueue() (q *Queue)

NewQueue init empty Queue.

func (*Queue) Delete

func (q *Queue) Delete(uid string)

Delete removes value from queue.

func (*Queue) GetByID

func (q *Queue) GetByID(uid string) interface{}

GetByID returns element from Queue by uid.

func (*Queue) GetFirst

func (q *Queue) GetFirst() interface{}

GetFirst returns first element from Queue.

func (*Queue) GetLast

func (q *Queue) GetLast() interface{}

GetLast returns last element from Queue.

func (*Queue) Init

func (*Queue) Init() *Queue

Init inits empty Queue.

func (*Queue) IsInQueue

func (q *Queue) IsInQueue(uid string) bool

GetFirst checks is element with given uid in Queue.

func (*Queue) Put

func (q *Queue) Put(uid string, data interface{})

Put adds value to queue.

Jump to

Keyboard shortcuts

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