functional

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[KT comparable, VT any] struct {
	*xsync.MapOf[KT, VT]
}

func NewMap

func NewMap[MapType Map[KT, VT], KT comparable, VT any]() Map[KT, VT]

func NewMapFrom

func NewMapFrom[KT comparable, VT any](m map[KT]VT) (res Map[KT, VT])

func NewMapOf

func NewMapOf[KT comparable, VT any](options ...func(*xsync.MapConfig)) Map[KT, VT]

func (Map[KT, VT]) CollectErrors

func (m Map[KT, VT]) CollectErrors(do func(k KT, v VT) error) []error

CollectErrors calls the given function for each key-value pair in the map, then returns a slice of errors collected.

func (Map[KT, VT]) Has

func (m Map[KT, VT]) Has(k KT) bool

func (Map[KT, VT]) RangeAll

func (m Map[KT, VT]) RangeAll(do func(k KT, v VT))

RangeAll calls the given function for each key-value pair in the map.

Parameters:

do: function to call for each key-value pair

Returns:

nothing

func (Map[KT, VT]) RangeAllParallel

func (m Map[KT, VT]) RangeAllParallel(do func(k KT, v VT))

RangeAllParallel calls the given function for each key-value pair in the map, in parallel. The map is not safe for modification from within the function.

Parameters:

do: function to call for each key-value pair

Returns:

nothing

func (Map[KT, VT]) String

func (m Map[KT, VT]) String() string

type Set

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func NewSet

func NewSet[T comparable]() Set[T]

func (Set[T]) Add

func (set Set[T]) Add(v T)

func (Set[T]) Clear

func (set Set[T]) Clear()

func (Set[T]) Contains

func (set Set[T]) Contains(v T) bool

func (Set[T]) IsEmpty

func (set Set[T]) IsEmpty() bool

func (Set[T]) Range

func (set Set[T]) Range(f func(T) bool)

func (Set[T]) RangeAll

func (set Set[T]) RangeAll(f func(T))

func (Set[T]) RangeAllParallel

func (set Set[T]) RangeAllParallel(f func(T))

func (Set[T]) Remove

func (set Set[T]) Remove(v T)

func (Set[T]) Size

func (set Set[T]) Size() int

Jump to

Keyboard shortcuts

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