package
Version:
v1.0.4
Opens a new window with list of versions in this module.
Published: Aug 24, 2022
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Queue is the main queue type.
New is used to create a new queue.
func (q *Queue[T]) Clear()
Clear empties the entire queue.
Contains returns true if the value exists in the queue, false if not.
Count returns the amount of entries in the queue.
func (q *Queue[T]) Dequeue() T
Dequeue returns the first value and removes it.
Empty returns true if the queue is empty, false if not.
func (q *Queue[T]) Enqueue(val T)
Enqueue add a value to the queue.
func (q Queue[T]) ForEach(f func(val T))
ForEach iterates over the dataset within the queue, calling the passed
function for each value.
func (q Queue[T]) Peek() T
Peek returns the first value.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.