map_

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBreak = it.ErrBreak

ErrBreak is For, Track breaker

Functions

func Copy

func Copy[M ~map[K]V, K comparable, V any](elements M) M

Copy makes a map copy.

func For

func For[M ~map[K]V, K comparable, V any](elements M, walker func(c.KV[K, V]) error) error

For applies a walker for every key/value pairs from a map. Key/value pair is boxed to the KV. To stop walking just return the ErrBreak.

func ForEach

func ForEach[M ~map[K]V, K comparable, V any](elements M, walker func(c.KV[K, V]))

ForEach applies a walker for every key/value pairs from a map. Key/value pair is boxed to the KV.

func ForEachKey

func ForEachKey[M ~map[K]V, K comparable, V any](elements M, walker func(K))

ForEachKey applies a walker for every key from a map.

func ForEachOrdered

func ForEachOrdered[M ~map[K]V, K comparable, V any](elements []K, uniques M, walker func(c.KV[K, V]))

ForEachOrdered applies a walker for every key/value pairs from a map in order. Key/value pair is boxed to the KV.

func ForEachOrderedValues

func ForEachOrderedValues[M ~map[K]V, K comparable, V any](elements []K, uniques M, walker func(V))

ForEachOrderedValues applies a walker for every value from a map in order.

func ForEachValue

func ForEachValue[M ~map[K]V, K comparable, V any](elements M, walker func(V))

ForEachValue applies a walker for every value from a map.

func ForKeys

func ForKeys[M ~map[K]V, K comparable, V any](elements M, walker func(K) error) error

ForKeys applies a walker for every key from a map. To stop walking just return the ErrBreak.

func ForOrdered

func ForOrdered[M ~map[K]V, K comparable, V any](elements []K, uniques M, walker func(c.KV[K, V]) error) error

ForOrdered applies a walker for every key/value pairs from a map in order. Key/value pair is boxed to the KV. To stop walking just return the ErrBreak.

func ForOrderedValues

func ForOrderedValues[M ~map[K]V, K comparable, V any](elements []K, uniques M, walker func(V) error) error

ForOrderedValues applies a walker for every value from a map in order. To stop walking just return the ErrBreak.

func ForValues

func ForValues[M ~map[K]V, K comparable, V any](elements M, walker func(V) error) error

ForValues applies a walker for every value from a map. To stop walking just return the ErrBreak.

func Keys

func Keys[M ~map[K]V, K comparable, V any](elements M) []K

Keys makes a slice of map keys.

func ToString

func ToString[M ~map[K]V, K comparable, V any](elements M) string

ToString converts elements to the string representation.

func ToStringOrdered

func ToStringOrdered[M ~map[K]V, K comparable, V any](order []K, elements M) string

ToStringOrdered converts elements to the string representation according to the order.

func ToStringOrderedf

func ToStringOrderedf[M ~map[K]V, K comparable, V any](order []K, elements M, kvFormat, delim string) string

ToStringOrderedf converts elements to a string representation using a key/value pair format and a delimeter. In order.

func ToStringf

func ToStringf[M ~map[K]V, K comparable, V any](elements M, kvFormat, delim string) string

ToStringf converts elements to a string representation using a key/value pair format and a delimeter.

func Track

func Track[M ~map[K]V, K comparable, V any](elements M, tracker func(K, V) error) error

Track applies a tracker for every key/value pairs from a map. To stop traking just return the ErrBreak.

func TrackEach

func TrackEach[M ~map[K]V, K comparable, V any](elements M, tracker func(K, V))

TrackEach applies a tracker for every key/value pairs from a map.

func TrackEachOrdered

func TrackEachOrdered[M ~map[K]V, K comparable, V any](elements []K, uniques M, tracker func(K, V))

TrackEachOrdered applies a tracker for every key/value pairs from a map in order.

func TrackOrdered

func TrackOrdered[M ~map[K]V, K comparable, V any](order []K, uniques M, tracker func(K, V) error) error

TrackOrdered applies a tracker for every key/value pairs from a map in order. To stop traking just return the ErrBreak.

Types

This section is empty.

Jump to

Keyboard shortcuts

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