queue

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigInfo

type ConfigInfo interface {
	GetName() string
}

Data the queue will hold In order to evaluate equivalence, the Name must be unique

type Queue

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

Queue uses slice as a data structure to hold elements new elements are appended as a last indexes in the slice meaning the oldest entries (First in) are at the start of the slice Queue is also thread safe and support usage over multiple goroutines

func (*Queue) CompareContent

func (q *Queue) CompareContent(w []string) bool

func (*Queue) Contains

func (q *Queue) Contains(element ConfigInfo) bool

Contains checks if the queue holds the specified element returns true if element found, based on the Name, false if no element has the same Name

func (*Queue) Dequeue

func (q *Queue) Dequeue() ConfigInfo

Dequeue will delete oldest element in the queue and return it returns nil if queue empty

func (*Queue) Enqueue

func (q *Queue) Enqueue(element ConfigInfo)

Enqueue will add a new element into the end of the queue

func (*Queue) GetContent

func (q *Queue) GetContent() []string

GetContent returns names of the items in the queue returns slice of names of the elements in the queue

Jump to

Keyboard shortcuts

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