orderedkeymap

package
v0.0.0-...-7a468ce Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrderedKeyMap

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

func New

func New[IK comparable, K, V any](internalKey func(K) IK) *OrderedKeyMap[IK, K, V]

New creates a new OrderedKeyMap with the given internal key function.

func (*OrderedKeyMap[IK, K, V]) All

func (m *OrderedKeyMap[IK, K, V]) All() iter.Seq2[K, V]

All returns an iterator over all key-value pairs in insertion order.

func (*OrderedKeyMap[IK, K, V]) Clear

func (m *OrderedKeyMap[IK, K, V]) Clear()

Clear removes all entries from the map.

func (*OrderedKeyMap[IK, K, V]) Delete

func (m *OrderedKeyMap[IK, K, V]) Delete(key K)

Delete removes the entry for the given key.

func (*OrderedKeyMap[IK, K, V]) Get

func (m *OrderedKeyMap[IK, K, V]) Get(key K) (V, bool)

Get returns the value for the given key and whether it was found.

func (*OrderedKeyMap[IK, K, V]) Keys

func (m *OrderedKeyMap[IK, K, V]) Keys() iter.Seq[K]

Keys returns an iterator over all keys in insertion order.

func (*OrderedKeyMap[IK, K, V]) Len

func (m *OrderedKeyMap[IK, K, V]) Len() int

Len returns the number of entries in the map.

func (*OrderedKeyMap[IK, K, V]) Set

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

Set inserts or updates the value for the given key, preserving insertion order.

func (*OrderedKeyMap[IK, K, V]) Value

func (m *OrderedKeyMap[IK, K, V]) Value(key K) V

Value returns the value for the given key, or the zero value if not found.

func (*OrderedKeyMap[IK, K, V]) Values

func (m *OrderedKeyMap[IK, K, V]) Values() iter.Seq[V]

Values returns an iterator over all values in insertion order.

Jump to

Keyboard shortcuts

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