mapper

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 2 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 Get

func Get[K comparable, V any](m map[K]V, k K) optioner.Option[V]

func Has

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

func Items added in v1.0.18

func Items[K comparable, V any](m map[K]V) optioner.Option[[]mapper.Item[K, V]]

func Keys

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

func KeysFiltered

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

func Values

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

func ValuesFiltered

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

Types

type Mapper

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

func New added in v1.0.18

func New[K comparable, V any]() Mapper[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]) Get

func (t Mapper[K, V]) Get(k K) optioner.Option[V]

func (Mapper[K, V]) Has

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() optioner.Option[[]mapper.Item[K, V]]

func (Mapper[K, V]) Keys

func (t Mapper[K, V]) Keys() optioner.Option[[]K]

func (Mapper[K, V]) Values

func (t Mapper[K, V]) Values() optioner.Option[[]V]

Jump to

Keyboard shortcuts

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