dict

package
v0.0.0-...-e348a8d Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dict

type Dict[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func New

func New[K comparable, V any](options ...Option[K, V]) *Dict[K, V]

func (*Dict[K, V]) Delete

func (slf *Dict[K, V]) Delete(k K)

func (*Dict[K, V]) Exist

func (slf *Dict[K, V]) Exist(key K) bool

func (*Dict[K, V]) ForEach

func (slf *Dict[K, V]) ForEach(f func(K, V))

func (*Dict[K, V]) Get

func (slf *Dict[K, V]) Get(k K) (V, bool)

func (*Dict[K, V]) Keys

func (slf *Dict[K, V]) Keys() []K

func (*Dict[K, V]) Len

func (slf *Dict[K, V]) Len() int

func (*Dict[K, V]) Map

func (slf *Dict[K, V]) Map() map[K]V

func (*Dict[K, V]) MarshalJSON

func (slf *Dict[K, V]) MarshalJSON() ([]byte, error)

func (*Dict[K, V]) Set

func (slf *Dict[K, V]) Set(k K, v V)

func (*Dict[K, V]) UnmarshalJSON

func (slf *Dict[K, V]) UnmarshalJSON(bytes []byte) error

func (*Dict[K, V]) Values

func (slf *Dict[K, V]) Values() []V

type Option

type Option[K comparable, V any] func(*Dict[K, V])

func WithSource

func WithSource[K comparable, V any](source map[K]V) Option[K, V]

Jump to

Keyboard shortcuts

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