collection

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(container interface{}, obj interface{}) (bool, error)

func ContainsAll

func ContainsAll(container interface{}, objs []interface{}) (bool, error)

func ContainsAny

func ContainsAny(container interface{}, objs []interface{}) (bool, error)

func Filter

func Filter(container interface{}, objs []interface{}) (interface{}, error)

func Join

func Join[T any](container interface{}, f func(interface{}) string, delimeter string) string

func Map

func Map[T any](container interface{}, f func(interface{}) T) []T

Types

type Set

type Set[T constraints.Ordered] map[T]struct{}

func MapToSet

func MapToSet[T constraints.Ordered](container interface{}, f func(interface{}) T) Set[T]

func (Set[T]) Add

func (s Set[T]) Add(key T)

func (Set[T]) AddAll added in v0.0.13

func (s Set[T]) AddAll(keys []T)

func (Set[T]) AsList

func (s Set[T]) AsList() []T

func (Set[T]) Delete

func (s Set[T]) Delete(key T)

func (Set[T]) DeleteAll added in v0.0.13

func (s Set[T]) DeleteAll(keys []T)

func (Set[T]) Has

func (s Set[T]) Has(key T) bool

Jump to

Keyboard shortcuts

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