queue

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrQueueEmpty = fmt.Errorf("Queue error: queue is empty, no value to get")

ErrQueueEmpty want using Top() or Pop() on a empty queue.

Functions

This section is empty.

Types

type Queue

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

Queue queue struct

func NewQueue

func NewQueue() *Queue

NewQueue declare a queue

func (*Queue) Empty

func (s *Queue) Empty() bool

Empty return the queue is empty

func (*Queue) Front

func (s *Queue) Front() (value interface{}, err error)

Top return the top value of the queue and do not pop it

func (*Queue) Len

func (s *Queue) Len() int

Len return the legnth of the queue

func (*Queue) Pop

func (s *Queue) Pop() (value interface{}, err error)

Pop a value from the queue

func (*Queue) Push

func (s *Queue) Push(value interface{})

Push a value to the queue

Jump to

Keyboard shortcuts

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