maps

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map = MapStrAny

Map alias of MapStrAny

type MapStr

type MapStr = MapStrAny

MapStr alias of MapStrAny

type MapStrAny

type MapStrAny map[string]interface{}

MapStrAny type of map[string}]inteface{}

func Make

func Make() MapStrAny

Make create a new instance (the default type of map)

func MakeMap

func MakeMap() MapStrAny

MakeMap create a new instance

func MakeMapStr

func MakeMapStr() MapStrAny

MakeMapStr create a new instance

func MakeMapStrAny

func MakeMapStrAny() MapStrAny

MakeMapStrAny create a new instance

func MakeStr

func MakeStr() MapStrAny

MakeStr create a new instance

func MakeStrAny

func MakeStrAny() MapStrAny

MakeStrAny create a new instance

func MapOf

func MapOf(values map[string]interface{}) MapStrAny

MapOf create a new instance

func MapStrAnyOf

func MapStrAnyOf(values map[string]interface{}) MapStrAny

MapStrAnyOf create a new instance (the default type of map)

func MapStrOf

func MapStrOf(values map[string]interface{}) MapStrAny

MapStrOf create a new instance

func Of

func Of(values map[string]interface{}) MapStrAny

Of create a new instance (the default type of map)

func StrAnyOf

func StrAnyOf(values map[string]interface{}) MapStrAny

StrAnyOf create a new instance

func StrOf

func StrOf(values map[string]interface{}) MapStrAny

StrOf create a new instance

func (MapStrAny) Del

func (m MapStrAny) Del(key string)

Del deletes the value for a key.

func (MapStrAny) Dot

func (m MapStrAny) Dot() MapStrAny

Dot The Dot method flattens a multi-dimensional map[string]inteface{} into a single level map[string]inteface{} that uses "dot" notation to indicate depth

func (MapStrAny) Flatten

func (m MapStrAny) Flatten() MapStrAny

Flatten The Flatten method is alias of Dot, to flatten a multi-dimensional map[string]inteface{} into a single level map[string]inteface{} that uses "dot" notation to indicate depth

func (MapStrAny) Get

func (m MapStrAny) Get(key string) interface{}

Get returns the value stored in the map for a key, or nil if no value is present.

func (MapStrAny) GetAndDel

func (m MapStrAny) GetAndDel(key string) interface{}

GetAndDel deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present.

func (MapStrAny) GetOrSet

func (m MapStrAny) GetOrSet(key string, value interface{}) interface{}

GetOrSet returns the existing value for the key if present. Otherwise, it stores and returns the given value.

func (MapStrAny) Has

func (m MapStrAny) Has(key string) bool

Has return true whether value was found in the map.

func (MapStrAny) IsEmpty

func (m MapStrAny) IsEmpty() bool

IsEmpty checks whether the map is empty. It returns true if map is empty, or else false.

func (MapStrAny) Keys

func (m MapStrAny) Keys() []string

Keys returns all keys of the map as a slice.

func (MapStrAny) Len

func (m MapStrAny) Len() int

Len returns the length of the map.

func (MapStrAny) Merge

func (m MapStrAny) Merge(maps ...interfaces.MapStrAny)

Merge merges hash maps

func (MapStrAny) Range

func (m MapStrAny) Range(cb func(key string, value interface{}) bool)

Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.

func (MapStrAny) Set

func (m MapStrAny) Set(key string, value interface{})

Set set the value for a key

func (MapStrAny) SetUnDot

func (m MapStrAny) SetUnDot(key string, value interface{})

SetUnDot set the value for a key uses "dot" notation

func (MapStrAny) UnDot

func (m MapStrAny) UnDot() MapStrAny

UnDot The UnDot method unflatten a single level map[string]inteface{} into multi-dimensional map[string]inteface{} that uses "dot" notation to indicate depth

func (MapStrAny) UnFlatten

func (m MapStrAny) UnFlatten() MapStrAny

UnFlatten The UnFlatten method unflatten a single level map[string]inteface{} into multi-dimensional map[string]inteface{} that uses "dot" notation to indicate depth

func (MapStrAny) Values

func (m MapStrAny) Values() []interface{}

Values returns all values of the map as a slice.

type MapStrAnySync

type MapStrAnySync struct {
	*sync.Map
}

MapStrAnySync type of sync.Map

func MakeMapStrAnySync

func MakeMapStrAnySync() MapStrAnySync

MakeMapStrAnySync create a new instance

func MakeMapStrSync

func MakeMapStrSync() MapStrAnySync

MakeMapStrSync create a new instance

func MakeMapSync

func MakeMapSync() MapStrAnySync

MakeMapSync create a new instance

func MakeStrAnySync

func MakeStrAnySync() MapStrAnySync

MakeStrAnySync create a new instance

func MakeStrSync

func MakeStrSync() MapStrAnySync

MakeStrSync create a new instance

func MakeSync

func MakeSync() MapStrAnySync

MakeSync create a new instance

func MapStrAnySyncOf

func MapStrAnySyncOf(data map[string]interface{}) MapStrAnySync

MapStrAnySyncOf create a new instance

func MapStrSyncOf

func MapStrSyncOf(data map[string]interface{}) MapStrAnySync

MapStrSyncOf create a new instance

func MapSyncOf

func MapSyncOf(data map[string]interface{}) MapStrAnySync

MapSyncOf create a new instance

func StrAnySyncOf

func StrAnySyncOf(data map[string]interface{}) MapStrAnySync

StrAnySyncOf create a new instance

func StrSyncOf

func StrSyncOf(data map[string]interface{}) MapStrAnySync

StrSyncOf create a new instance

func SyncOf

func SyncOf(data map[string]interface{}) MapStrAnySync

SyncOf create a new instance

func (MapStrAnySync) Del

func (m MapStrAnySync) Del(key string)

Del deletes the value for a key.

func (MapStrAnySync) Dot

func (m MapStrAnySync) Dot() MapStrAnySync

Dot The Dot method flattens a multi-dimensional map[string]inteface{} into a single level map[string]inteface{} that uses "dot" notation to indicate depth

func (MapStrAnySync) Flatten

func (m MapStrAnySync) Flatten() MapStrAnySync

Flatten The Flatten method is alias of Dot, to flatten a multi-dimensional map[string]inteface{} into a single level map[string]inteface{} that uses "dot" notation to indicate depth

func (MapStrAnySync) Get

func (m MapStrAnySync) Get(key string) interface{}

Get get the value of the given key

func (MapStrAnySync) GetAndDel

func (m MapStrAnySync) GetAndDel(key string) interface{}

GetAndDel deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present.

func (MapStrAnySync) GetOrSet

func (m MapStrAnySync) GetOrSet(key string, value interface{}) interface{}

GetOrSet returns the existing value for the key if present. Otherwise, it stores and returns the given value.

func (MapStrAnySync) Has

func (m MapStrAnySync) Has(key string) bool

Has return true whether value was found in the map.

func (MapStrAnySync) IsEmpty

func (m MapStrAnySync) IsEmpty() bool

IsEmpty checks whether the map is empty. It returns true if map is empty, or else false.

func (MapStrAnySync) Keys

func (m MapStrAnySync) Keys() []string

Keys returns all keys of the map as a slice.

func (MapStrAnySync) Len

func (m MapStrAnySync) Len() int

Len returns the length of the map.

func (MapStrAnySync) MarshalJSON added in v0.8.0

func (m MapStrAnySync) MarshalJSON() ([]byte, error)

MarshalJSON for json marshalJSON

func (MapStrAnySync) Merge

func (m MapStrAnySync) Merge(maps ...interfaces.MapStrAny)

Merge merges hash maps

func (MapStrAnySync) Range

func (m MapStrAnySync) Range(cb func(key string, value interface{}) bool)

Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.

func (MapStrAnySync) Set

func (m MapStrAnySync) Set(key string, value interface{})

Set set the value for a key

func (MapStrAnySync) Values

func (m MapStrAnySync) Values() []interface{}

Values returns all values of the map as a slice.

type MapStrSync

type MapStrSync = MapStrAnySync

MapStrSync alias of MapStrAnySync

type MapSync

type MapSync = MapStrAnySync

MapSync alias of MapStrAnySync

type Str

type Str = MapStrAny

Str alias of MapStrAny

type StrAny

type StrAny = MapStrAny

StrAny alias of MapStrAny

type StrAnySync

type StrAnySync = MapStrAnySync

StrAnySync alias of MapStrAnySync

type StrSync

type StrSync = MapStrAnySync

StrSync alias of MapStrAnySync

Jump to

Keyboard shortcuts

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