Help us shape the future of Go! Take the 2026 Go Developer Survey

queue

package
v0.12.19 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 1 Imported by: 0

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 implements a first-in-first-out queue backed by a channel-driven core.

func (*FiFo[T]) Insert

func (q *FiFo[T]) Insert(items ...*T)

Insert appends the provided items to the tail of the queue.

func (*FiFo[T]) Pop

func (q *FiFo[T]) Pop() (*T, error)

Pop removes and returns the oldest item in the queue.

type LiFo

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

LiFo implements a last-in-first-out stack backed by a channel-driven core.

func (*LiFo[T]) Insert

func (q *LiFo[T]) Insert(items ...*T)

Insert pushes the provided items onto the stack in order.

func (*LiFo[T]) Pop

func (q *LiFo[T]) Pop() (*T, error)

Pop removes and returns the most recently inserted item.

Source Files

  • fifo.go
  • lifo.go
  • queue.go

Jump to

Keyboard shortcuts

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