ordered_map

package
v0.0.154 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map interface {
	Set(key string, val interface{})
	Get(key string) interface{}
	Has(key string) bool
	GetOK(key string) (val interface{}, ok bool)
	Range(fn func(key string, val interface{}) bool)
}

func NewOrderedMap

func NewOrderedMap(opts ...Option) Map

type Option

type Option func(cfg *mapConfig)

func WithCapacity

func WithCapacity(capacity int) Option

type OrderedMap

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

OrderedMap is a map that maintains the order of the keys it is useful for encoding and decoding JSON

func (*OrderedMap) Add

func (c *OrderedMap) Add(key string, val interface{})

func (*OrderedMap) Get

func (c *OrderedMap) Get(key string) interface{}

func (*OrderedMap) GetOK

func (c *OrderedMap) GetOK(key string) (val interface{}, ok bool)

func (*OrderedMap) Has

func (c *OrderedMap) Has(key string) bool

func (*OrderedMap) MarshalJSON

func (c *OrderedMap) MarshalJSON() ([]byte, error)

func (*OrderedMap) Range

func (c *OrderedMap) Range(fn func(key string, val interface{}) bool)

func (*OrderedMap) Set

func (c *OrderedMap) Set(key string, val interface{})

func (*OrderedMap) UnmarshalJSON

func (c *OrderedMap) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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