mapper

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Each

func Each[K comparable, V any](m map[K]V, fn func(K, V))

func EachErr

func EachErr[K comparable, V any](m map[K]V, fn func(K, V) error) error

func Has added in v1.0.18

func Has[K comparable, V any](m map[K]V, k K) bool

func Keys

func Keys[K comparable, V any](m map[K]V) []K

func KeysFiltered

func KeysFiltered[K comparable, V any](m map[K]V, fn func(K) bool) []K

func Values

func Values[K comparable, V any](m map[K]V) []V

func ValuesFiltered

func ValuesFiltered[K comparable, V any](m map[K]V, fn func(V) bool) []V

Types

type Item added in v1.0.18

type Item[K comparable, V any] struct {
	K K
	V V
}

func Items added in v1.0.18

func Items[K comparable, V any](m map[K]V) []Item[K, V]

type Mapper added in v1.0.18

type Mapper[K comparable, V any] map[K]V

func (Mapper[K, V]) Each added in v1.0.18

func (t Mapper[K, V]) Each(fn func(K, V))

func (Mapper[K, V]) EachErr added in v1.0.18

func (t Mapper[K, V]) EachErr(fn func(K, V) error) error

func (Mapper[K, V]) Has added in v1.0.18

func (t Mapper[K, V]) Has(k K) bool

func (Mapper[K, V]) Items added in v1.0.18

func (t Mapper[K, V]) Items() []Item[K, V]

func (Mapper[K, V]) Keys added in v1.0.18

func (t Mapper[K, V]) Keys() []K

func (Mapper[K, V]) KeysFiltered added in v1.0.18

func (t Mapper[K, V]) KeysFiltered(fn func(K) bool) []K

func (Mapper[K, V]) Values added in v1.0.18

func (t Mapper[K, V]) Values() []V

func (Mapper[K, V]) ValuesFiltered added in v1.0.18

func (t Mapper[K, V]) ValuesFiltered(fn func(V) bool) []V

Jump to

Keyboard shortcuts

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