queue

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 0 Imported by: 0

README

Build Status Go Reference Go Report Card

queue

A simple Go (golang) library for queues

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FIFO

type FIFO[T any] struct {
	// contains filtered or unexported fields
}

FIFO is a naive implementation of a FIFO genric queue

func (*FIFO[T]) Add

func (q *FIFO[T]) Add(t T)

Add an element to the Queue

func (*FIFO[T]) All

func (q *FIFO[T]) All() []T

All elements in the queue as a copy of the current queue

func (*FIFO[T]) Clear

func (q *FIFO[T]) Clear()

Clear Queue back to initial state

func (*FIFO[T]) More

func (q *FIFO[T]) More() bool

More returns if Queue has more data to give

func (*FIFO[T]) Next

func (q *FIFO[T]) Next() T

Next gets the next element in the queue and removes it from the Queue

func (*FIFO[T]) Size

func (q *FIFO[T]) Size() int

Size of the Queue

Jump to

Keyboard shortcuts

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