maptool

package
v0.0.0-...-2dc6276 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCombineArgs

func CheckCombineArgs(keysNeeded []string, args ...map[string]interface{}) (map[string]interface{}, error)

combine args and check keys

func Copy

func Copy[T constraints.Ordered, P any](targetMap map[T]P) map[T]P

copy map with single level

func Keys

func Keys[T constraints.Ordered, P any](objMap map[T]P) []T

return keys from map object

func Pop

func Pop[T constraints.Ordered, P any](targetMap map[T]P, key T) (P, bool)

pop key from map

func Update

func Update[T constraints.Ordered, P any](targetMap map[T]P, srcMaps ...map[T]P)

update keys value

func Values

func Values[T constraints.Ordered, P any](objMap map[T]P) []P

Types

type OrderedMap

type OrderedMap[T any] struct {
	Order []string
	Map   map[string]T
}

func NewOrderedMap

func NewOrderedMap[T any]() OrderedMap[T]

func (*OrderedMap[T]) Append

func (s *OrderedMap[T]) Append(key string, val T)

func (OrderedMap[T]) MarshalJSON

func (s OrderedMap[T]) MarshalJSON() ([]byte, error)

func (*OrderedMap[T]) OrderBy

func (s *OrderedMap[T]) OrderBy(keys ...string)

orderBy

func (*OrderedMap[T]) Pop

func (s *OrderedMap[T]) Pop(key string) (T, bool)

func (*OrderedMap[T]) UnmarshalJSON

func (s *OrderedMap[T]) UnmarshalJSON(b []byte) error

func (*OrderedMap[T]) UnmarshalYAML

func (s *OrderedMap[T]) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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