ordered

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: BSD-3-Clause, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyTypeNotString = errors.New("key type must be string")
	ErrNilOrderedMap    = errors.New("calling MarshalJSON on nil OrderedMap")
)

Functions

This section is empty.

Types

type Map

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

func NewMap

func NewMap[K comparable, V any](opts ...Option) *Map[K, V]

func (*Map[K, V]) Clear

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

func (*Map[K, V]) Clone

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

func (*Map[K, V]) Del

func (o *Map[K, V]) Del(key K)

func (*Map[K, V]) Get

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

func (*Map[K, V]) Iter

func (o *Map[K, V]) Iter(yield func(key K, value V) bool)

func (*Map[K, V]) Keys

func (o *Map[K, V]) Keys() []K

func (*Map[K, V]) Len

func (o *Map[K, V]) Len() int

func (*Map[K, V]) MarshalJSON

func (o *Map[K, V]) MarshalJSON() ([]byte, error)

func (*Map[K, V]) Set

func (o *Map[K, V]) Set(key K, value V)

func (*Map[K, V]) TryGet

func (o *Map[K, V]) TryGet(key K) (V, bool)

func (*Map[K, V]) Values

func (o *Map[K, V]) Values() []V

type Option

type Option func(*option)

func WithCapacity

func WithCapacity(capacity int) Option

Jump to

Keyboard shortcuts

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