linkedmap

package
v0.0.0-...-ec0d933 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

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

func New

func New[K comparable, V any](options ...Option[K, V]) *Map[K, V]

func (*Map[K, V]) Clear

func (m *Map[K, V]) Clear()

func (*Map[K, V]) Clone

func (l *Map[K, V]) Clone() *Map[K, V]

func (*Map[K, V]) ContainsKey

func (m *Map[K, V]) ContainsKey(key K) bool

func (*Map[K, V]) Delete

func (l *Map[K, V]) Delete(key K) (V, bool)

func (*Map[K, V]) Entries

func (l *Map[K, V]) Entries() iter.Seq2[K, V]

func (*Map[K, V]) Get

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

func (*Map[K, V]) Keys

func (l *Map[K, V]) Keys() iter.Seq[K]

func (*Map[K, V]) Put

func (m *Map[K, V]) Put(key K, value V) (V, bool)

func (*Map[K, V]) Size

func (m *Map[K, V]) Size() int

func (*Map[K, V]) String

func (m *Map[K, V]) String() string

String returns a string representation of container

func (*Map[K, V]) Values

func (l *Map[K, V]) Values() iter.Seq[V]

type MapJSON

type MapJSON Map[string, any]

func NewJSON

func NewJSON() *MapJSON

func (*MapJSON) MarshalJSON

func (mj *MapJSON) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface, so it could be serialized. When serializing, the keys of the map will keep the order they are added.

func (*MapJSON) UnmarshalJSON

func (m *MapJSON) UnmarshalJSON(b []byte) error

func (*MapJSON) Unwrap

func (m *MapJSON) Unwrap() *Map[string, any]

type Option

type Option[K comparable, V any] func(*Map[K, V])

func WithCapacity

func WithCapacity[K comparable, V any](capacity int) Option[K, V]

Jump to

Keyboard shortcuts

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