orderedmap

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrderedMap

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

OrderedMap is a map where the keys keep the order that they're added. It also can be de/serialized from/to JSON

func New

func New() *OrderedMap

New creates a new OrderedMap instrance

func (*OrderedMap) Del

func (o *OrderedMap) Del(key string)

Del deletes the values associated with key.

func (*OrderedMap) Get

func (o *OrderedMap) Get(key string) (interface{}, bool)

Get gets the value associated with the given key

func (*OrderedMap) Keys

func (o *OrderedMap) Keys() []string

Keys returns ordered keys

func (*OrderedMap) Len

func (o *OrderedMap) Len() int

Len returns the number of map

func (*OrderedMap) MarshalJSON

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

MarshalJSON implements the json.Marshaler interface.

func (*OrderedMap) Set

func (o *OrderedMap) Set(key string, value interface{})

Set sets the associated value with given key

func (*OrderedMap) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaler interface.

Jump to

Keyboard shortcuts

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