omap

package
v1.3.6-beta5 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(m any, f func(parent any, key any, value any) bool)

func Walkable

func Walkable(i any) bool

Types

type OrderedMap

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

func BuildGeneralMap

func BuildGeneralMap[V any](m any) *OrderedMap[string, V]

func Merge

func Merge[T comparable, V any](dicts ...*OrderedMap[T, V]) *OrderedMap[T, V]

func NewEmptyOrderedMap

func NewEmptyOrderedMap[T comparable, V any]() *OrderedMap[T, V]

func NewGeneralOrderedMap

func NewGeneralOrderedMap() *OrderedMap[string, any]

func NewOrderedMap

func NewOrderedMap[T comparable, V any](m map[T]V, initOrder ...func(int, int) bool) *OrderedMap[T, V]

func (*OrderedMap[T, V]) Add

func (o *OrderedMap[T, V]) Add(v V) error

func (*OrderedMap[T, V]) BringKeyToLastOne added in v1.3.1

func (o *OrderedMap[T, V]) BringKeyToLastOne(target T)

func (*OrderedMap[T, V]) CanAsList

func (s *OrderedMap[T, V]) CanAsList() bool

func (*OrderedMap[T, V]) Copy

func (s *OrderedMap[T, V]) Copy() *OrderedMap[T, V]

func (*OrderedMap[T, V]) Delete

func (o *OrderedMap[T, V]) Delete(key T)

func (*OrderedMap[T, V]) Field

func (o *OrderedMap[T, V]) Field(key T) *OrderedMap[string, V]

func (*OrderedMap[T, V]) Filter

func (o *OrderedMap[T, V]) Filter(f func(T, V) (bool, error)) *OrderedMap[T, V]

func (*OrderedMap[T, V]) First

func (o *OrderedMap[T, V]) First() (T, V, bool)

func (*OrderedMap[T, V]) Flat

func (o *OrderedMap[T, V]) Flat(f func(T, V) (struct {
	Key   T
	Value V
}, error)) *OrderedMap[T, V]

func (*OrderedMap[T, V]) ForEach

func (o *OrderedMap[T, V]) ForEach(handler func(i T, v V) bool)

func (*OrderedMap[T, V]) Get

func (o *OrderedMap[T, V]) Get(key T) (V, bool)

func (*OrderedMap[T, V]) GetByIndex

func (o *OrderedMap[T, V]) GetByIndex(index int) (V, bool)

func (*OrderedMap[T, V]) GetByIndexMust

func (o *OrderedMap[T, V]) GetByIndexMust(index int) V

func (*OrderedMap[T, V]) GetMap added in v1.3.1

func (o *OrderedMap[T, V]) GetMap() map[T]V

func (*OrderedMap[T, V]) GetMust

func (o *OrderedMap[T, V]) GetMust(key T) V

func (*OrderedMap[T, V]) GetParent

func (o *OrderedMap[T, V]) GetParent() *OrderedMap[T, V]

func (*OrderedMap[T, V]) GetRoot

func (o *OrderedMap[T, V]) GetRoot() (*OrderedMap[T, V], bool)

func (*OrderedMap[T, V]) Have

func (o *OrderedMap[T, V]) Have(i any) bool

func (*OrderedMap[T, V]) HaveLiteralValue

func (i *OrderedMap[T, V]) HaveLiteralValue() bool

func (*OrderedMap[T, V]) Index

func (o *OrderedMap[T, V]) Index(i int) *OrderedMap[string, V]

func (*OrderedMap[T, V]) Jsonify added in v1.3.1

func (v *OrderedMap[T, V]) Jsonify() []byte

func (*OrderedMap[T, V]) Keys

func (o *OrderedMap[T, V]) Keys() []T

func (*OrderedMap[T, V]) Last

func (o *OrderedMap[T, V]) Last() (T, V, bool)

func (*OrderedMap[T, V]) Len

func (o *OrderedMap[T, V]) Len() int

func (*OrderedMap[T, V]) LiteralValue

func (i *OrderedMap[T, V]) LiteralValue() any

func (*OrderedMap[T, V]) Map

func (o *OrderedMap[T, V]) Map(f func(T, V) (T, V, error)) *OrderedMap[T, V]

func (*OrderedMap[T, V]) MarshalJSON added in v1.3.1

func (v *OrderedMap[T, V]) MarshalJSON() ([]byte, error)

func (*OrderedMap[T, V]) MarshalJSONWithKeyValueFetcher added in v1.3.3

func (v *OrderedMap[T, V]) MarshalJSONWithKeyValueFetcher(k func(t any) ([]byte, error), vf func(any) ([]byte, error)) ([]byte, error)

func (*OrderedMap[T, V]) Merge

func (s *OrderedMap[T, V]) Merge(i ...*OrderedMap[T, V]) *OrderedMap[T, V]

func (*OrderedMap[T, V]) Pop added in v1.3.1

func (s *OrderedMap[T, V]) Pop() V

func (*OrderedMap[T, V]) Push added in v1.3.1

func (s *OrderedMap[T, V]) Push(a V) error

func (*OrderedMap[T, V]) SearchGlobKey

func (s *OrderedMap[T, V]) SearchGlobKey(i string, seps ...string) (*OrderedMap[T, V], error)

func (*OrderedMap[T, V]) SearchIndexKey

func (s *OrderedMap[T, V]) SearchIndexKey(i ...int) (*OrderedMap[T, V], error)

func (*OrderedMap[T, V]) SearchKey

func (s *OrderedMap[T, V]) SearchKey(i ...string) (*OrderedMap[T, V], error)

func (*OrderedMap[T, V]) SearchKeyByValue

func (s *OrderedMap[T, V]) SearchKeyByValue(i ...string) (*OrderedMap[T, V], error)

func (*OrderedMap[T, V]) SearchRegexKey

func (s *OrderedMap[T, V]) SearchRegexKey(i string) (*OrderedMap[T, V], error)

func (*OrderedMap[T, V]) SearchValue

func (s *OrderedMap[T, V]) SearchValue(i ...string) (*OrderedMap[T, V], error)

func (*OrderedMap[T, V]) Set

func (o *OrderedMap[T, V]) Set(key T, v V)

func (*OrderedMap[T, V]) SetLiteralValue

func (i *OrderedMap[T, V]) SetLiteralValue(val any)

func (*OrderedMap[T, V]) Shift added in v1.3.2

func (s *OrderedMap[T, V]) Shift() V

func (*OrderedMap[T, V]) String

func (s *OrderedMap[T, V]) String() string

func (*OrderedMap[T, V]) UnmarshalJSON added in v1.3.3

func (v *OrderedMap[T, V]) UnmarshalJSON(raw []byte) error

func (*OrderedMap[T, V]) UnsetParent

func (s *OrderedMap[T, V]) UnsetParent()

func (*OrderedMap[T, V]) Values

func (o *OrderedMap[T, V]) Values() []V

func (*OrderedMap[T, V]) ValuesMap

func (o *OrderedMap[T, V]) ValuesMap() *OrderedMap[string, V]

func (*OrderedMap[T, V]) WalkMap

func (m *OrderedMap[T, V]) WalkMap(visited *sync.Map, f func(self, key, value any) bool)

func (*OrderedMap[T, V]) WalkSearchGlobKey

func (s *OrderedMap[T, V]) WalkSearchGlobKey(i string, seps ...string) (*OrderedMap[T, V], error)

func (*OrderedMap[T, V]) WalkSearchRegexpKey

func (s *OrderedMap[T, V]) WalkSearchRegexpKey(i string) (*OrderedMap[T, V], error)

Jump to

Keyboard shortcuts

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