mapper

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 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

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

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

func Items

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

func ItemsFiltered

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

type Mapper

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

func (Mapper[K, V]) Each

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

func (Mapper[K, V]) EachErr

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

func (Mapper[K, V]) Has

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

func (Mapper[K, V]) Items

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

func (Mapper[K, V]) Keys

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

func (Mapper[K, V]) KeysFiltered

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

func (Mapper[K, V]) Values

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

func (Mapper[K, V]) ValuesFiltered

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