internal

package
v1.5.50 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Iterate

func Iterate[T any](list []T) iter.Seq[T]

func IterateMapAlphabetically added in v1.5.39

func IterateMapAlphabetically[K comparable, V any](m map[K]V, nameExtractor func(K) string) iter.Seq2[K, V]

func List

func List[T any](i iter.Seq[T]) (list []T)

func ToMap

func ToMap[K comparable, V any](i iter.Seq[V], keyExtractor func(v V) K) (result map[K]V)

Types

type JSONMap

type JSONMap struct {
	OrderedMap[string, any]
}

func NewJSONMap

func NewJSONMap() *JSONMap

func (*JSONMap) MarshalJSON

func (om *JSONMap) MarshalJSON() ([]byte, error)

func (*JSONMap) UnmarshalJSON

func (o *JSONMap) UnmarshalJSON(b []byte) (err error)

type MapMarshaler

type MapMarshaler interface {
	ToMap() (map[string]any, error)
	FromMap(map[string]any) error
}

type OrderedMap

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

func NewOrderedMap

func NewOrderedMap[K comparable, V any]() *OrderedMap[K, V]

func (*OrderedMap[K, V]) Get

func (om *OrderedMap[K, V]) Get(key K) (value V, ok bool)

func (*OrderedMap[K, V]) Keys

func (om *OrderedMap[K, V]) Keys() []K

func (*OrderedMap[K, V]) Len

func (om *OrderedMap[K, V]) Len() int

func (*OrderedMap[K, V]) Pairs

func (om *OrderedMap[K, V]) Pairs() iter.Seq2[K, V]

func (*OrderedMap[K, V]) Remove

func (om *OrderedMap[K, V]) Remove(key K) (value V, ok bool)

func (*OrderedMap[K, V]) Set

func (om *OrderedMap[K, V]) Set(key K, value V)

func (*OrderedMap[K, V]) Sort

func (om *OrderedMap[K, V]) Sort(compare func(a, b K) int)

func (*OrderedMap[K, V]) SortKeys

func (om *OrderedMap[K, V]) SortKeys(sort func(keys []K))

func (*OrderedMap[K, V]) Values

func (om *OrderedMap[K, V]) Values() iter.Seq[V]

type Stack

type Stack[T any] struct {
	// contains filtered or unexported fields
}

func (*Stack[T]) Len

func (s *Stack[T]) Len() int

func (*Stack[T]) Peek

func (s *Stack[T]) Peek() (v T)

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() (v T, ok bool)

func (*Stack[T]) Push

func (s *Stack[T]) Push(v T)

type YamlMap

type YamlMap[V MapMarshaler] struct {
	OrderedMap[string, V]
}

func NewYamlMap

func NewYamlMap[V MapMarshaler]() *YamlMap[V]

func (*YamlMap[V]) MarshalYAML

func (om *YamlMap[V]) MarshalYAML() ([]byte, error)

func (*YamlMap[V]) UnmarshalYAML

func (t *YamlMap[V]) UnmarshalYAML(unmarshal func(any) error) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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