orderedmap

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValue

type KeyValue struct {
	Key   string
	Value any
}

KeyValue is a single key value pair from a *Map.

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map is a map implementation that maintains ordering of keys.

func FromMap

func FromMap(source map[string]any) *Map

FromMap creates a *Map from the input map. Note that while the contents will be ordered, the ordering is not guaranteed since the input map is unordered.

func NewMap

func NewMap() *Map

NewMap returns a new *Map that has its values initialised.

func (*Map) Delete

func (m *Map) Delete(key string) *Map

Delete deletes the value found under the given key.

func (*Map) Equal

func (m *Map) Equal(other *Map) bool

func (*Map) Get

func (m *Map) Get(key string) (any, bool)

Get returns the value found under the given key.

func (*Map) KeyValues

func (m *Map) KeyValues() []KeyValue

KeyValues returns the KeyValue pairs within the map, in the order that they were added.

func (*Map) Keys

func (m *Map) Keys() []string

Keys returns all the keys from the map.

func (*Map) Len

func (m *Map) Len() int

func (*Map) Set

func (m *Map) Set(key string, value any) *Map

Set sets a value under the given key.

func (*Map) UnorderedData

func (m *Map) UnorderedData() map[string]any

UnorderedData returns all the data from the map.

Jump to

Keyboard shortcuts

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