maps

package
v0.0.5-beta.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 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 InsertMap

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

InsertMap is a map that preserves initial insertion order.

func NewInsertMap

func NewInsertMap[K comparable, V any](entries ...MapEntry[K, V]) InsertMap[K, V]

func (InsertMap[K, V]) Copy

func (m InsertMap[K, V]) Copy() InsertMap[K, V]

func (InsertMap[K, V]) Entries

func (m InsertMap[K, V]) Entries() []MapEntry[K, V]

func (InsertMap[K, V]) Get

func (m InsertMap[K, V]) Get(key K) (V, bool)

func (InsertMap[K, V]) Keys

func (m InsertMap[K, V]) Keys() []K

func (InsertMap[K, V]) Len

func (m InsertMap[K, V]) Len() int

func (*InsertMap[K, V]) Set

func (m *InsertMap[K, V]) Set(key K, value V)

func (*InsertMap[K, V]) SetEntries

func (m *InsertMap[K, V]) SetEntries(entries ...MapEntry[K, V])

func (*InsertMap[K, V]) SetKey

func (m *InsertMap[K, V]) SetKey(key K)

func (InsertMap[K, V]) Values

func (m InsertMap[K, V]) Values() []V

type MapEntry

type MapEntry[K comparable, V interface{}] struct {
	Key   K
	Value V
}

type StringMap

type StringMap[T interface{}] map[string]T

func (StringMap[T]) OrderedEntries

func (m StringMap[T]) OrderedEntries() []StringMapEntry[T]

OrderedEntries returns the entries of the map in naturally sorted order by key.

func (StringMap[T]) WithValue

func (m StringMap[T]) WithValue(key string, value T) StringMap[T]

type StringMapEntry

type StringMapEntry[T interface{}] MapEntry[string, T]

Jump to

Keyboard shortcuts

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