Documentation
¶
Index ¶
- func Iterate[T any](list []T) iter.Seq[T]
- func IterateMapAlphabetically[K comparable, V any](m map[K]V, nameExtractor func(K) string) iter.Seq2[K, V]
- func List[T any](i iter.Seq[T]) (list []T)
- func ToMap[K comparable, V any](i iter.Seq[V], keyExtractor func(v V) K) (result map[K]V)
- type JSONMap
- type MapMarshaler
- type OrderedMap
- func (om *OrderedMap[K, V]) Get(key K) (value V, ok bool)
- func (om *OrderedMap[K, V]) Keys() []K
- func (om *OrderedMap[K, V]) Len() int
- func (om *OrderedMap[K, V]) Pairs() iter.Seq2[K, V]
- func (om *OrderedMap[K, V]) Remove(key K) (value V, ok bool)
- func (om *OrderedMap[K, V]) Set(key K, value V)
- func (om *OrderedMap[K, V]) Sort(compare func(a, b K) int)
- func (om *OrderedMap[K, V]) SortKeys(sort func(keys []K))
- func (om *OrderedMap[K, V]) Values() iter.Seq[V]
- type Stack
- type YamlMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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]
Types ¶
type JSONMap ¶
type JSONMap struct { OrderedMap[string, any] }
func NewJSONMap ¶
func NewJSONMap() *JSONMap
func (*JSONMap) MarshalJSON ¶
func (*JSONMap) UnmarshalJSON ¶
type MapMarshaler ¶
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 YamlMap ¶
type YamlMap[V MapMarshaler] struct { OrderedMap[string, V] }
func NewYamlMap ¶
func NewYamlMap[V MapMarshaler]() *YamlMap[V]
func (*YamlMap[V]) MarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.