Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateChecksum ¶
CalculateChecksum calculates a Blake2b 256 bit checksum of the passed data and returns it as a []byte.
Types ¶
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 go-routines
func (*Queue) CompareElementNameList ¶
CompareElementNameList compares given element-name list with the current element-name list of the queue
func (*Queue) Contains ¶
func (q *Queue) Contains(targetElement QueueElement) bool
Checks if the queue holds the specified elements checking is done by name of the element
func (*Queue) Dequeue ¶
func (q *Queue) Dequeue() QueueElement
Dequeue will delete oldest element in the queue and return it Returns nil if queue is empty
func (*Queue) Enqueue ¶
func (q *Queue) Enqueue(element QueueElement)
Enqueue will add a new element into the end of the queue
func (*Queue) GetElementNames ¶
GetElementNames returns slice of names of the elements in the queue
type QueueElement ¶
type QueueElement interface { // name of each item must be unique GetName() string }