collections

package
v0.88.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrObjectNotFound = errors.New("object does not exist")

Functions

func FindOne

func FindOne[T any](collection []T, condition func(T) bool) (*T, error)

func Map added in v0.88.0

func Map[T any, R any](collection []T, mapper func(T) R) []R

Types

type Queue added in v0.76.0

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

func NewQueue added in v0.76.0

func NewQueue[T any]() Queue[T]

func (*Queue[T]) Head added in v0.76.0

func (s *Queue[T]) Head() *T

func (*Queue[T]) Pop added in v0.76.0

func (s *Queue[T]) Pop() *T

func (*Queue[T]) Push added in v0.76.0

func (s *Queue[T]) Push(elem T)

Jump to

Keyboard shortcuts

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