maps

package module
v0.0.0-...-1fe1c74 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 11 Imported by: 12

README

maps

Map Data Structures

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnmarshalerType = reflect.TypeOf((*MapUnmarshaler)(nil)).Elem()

Functions

func DecoderConfig

func DecoderConfig(config *mapstructure.DecoderConfig)

Types

type DecoderConfigOption

type DecoderConfigOption func(*mapstructure.DecoderConfig)

A DecoderConfigOption can be passed to viper.Unmarshal to configure mapstructure.DecoderConfig options

func DecodeHook

DecodeHook returns a DecoderConfigOption which overrides the default DecoderConfig.DecodeHook value, the default is:

 mapstructure.ComposeDecodeHookFunc(
		mapstructure.StringToTimeDurationHookFunc(),
		mapstructure.StringToSliceHookFunc(","),
	)

type Map

type Map map[interface{}]interface{}

func (*Map) Del

func (this *Map) Del(key ...interface{})

func (Map) Get

func (this Map) Get(key interface{}) (value interface{}, ok bool)

func (*Map) GetDel

func (this *Map) GetDel(key interface{}) (value interface{}, ok bool)

func (Map) GetString

func (this Map) GetString(key interface{}, defaul ...string) (value string)

func (*Map) Has

func (this *Map) Has(key ...interface{}) (ok bool)

func (*Map) HasOne

func (this *Map) HasOne(key ...interface{}) (ok bool)

func (*Map) Set

func (this *Map) Set(key interface{}, value interface{}) *Map

func (*Map) Update

func (this *Map) Update(m_ ...map[interface{}]interface{}) *Map

func (Map) Value

func (this Map) Value(key interface{}) (value interface{})

type MapSI

type MapSI map[string]interface{}

func GetMapSI

func GetMapSI(getter getters.Getter, key string) (m MapSI, ok bool)

func (MapSI) AormDataType

func (this MapSI) AormDataType(dialect aorm.Dialector) string

func (MapSI) CopyTo

func (this MapSI) CopyTo(dest interface{}, opts ...DecoderConfigOption) error

CopyTo copy the config into a Struct. Make sure that the tags on the fields of the structure are properly set.

func (MapSI) DeepCopy

func (this MapSI) DeepCopy(dest interface{}, cb ...func(m MapSI, key string, value interface{}) (interface{}, error)) (err error)

DeepCopyTo deep copy the config into a dest.

func (*MapSI) Del

func (this *MapSI) Del(key ...string)

func (MapSI) Find

func (this MapSI) Find(pth ...string) (value interface{}, ok bool)

func (MapSI) Get

func (this MapSI) Get(key string) (value interface{}, ok bool)

func (*MapSI) GetDel

func (this *MapSI) GetDel(key string) (value interface{}, ok bool)

func (*MapSI) GetMap

func (this *MapSI) GetMap(key string) (value Map, ok bool)

func (*MapSI) GetMapS

func (this *MapSI) GetMapS(key string) (value MapSI, ok bool)

func (*MapSI) Getter

func (this *MapSI) Getter() getters.Getter

func (MapSI) Has

func (this MapSI) Has(key ...string) (ok bool)

func (*MapSI) HasOne

func (this *MapSI) HasOne(key ...string) (ok bool)

func (*MapSI) ReadKey

func (this *MapSI) ReadKey(getter getters.Getter, key interface{}) (ok bool)

func (*MapSI) Scan

func (this *MapSI) Scan(src interface{}) (err error)

func (*MapSI) Set

func (this *MapSI) Set(key string, value interface{}) *MapSI

func (MapSI) Unmarshal

func (this MapSI) Unmarshal(rawVal interface{}, opts ...DecoderConfigOption) error

Unmarshal unmarshals the config into a Struct. Make sure that the tags on the fields of the structure are properly set.

func (*MapSI) Update

func (this *MapSI) Update(m_ ...map[string]interface{}) *MapSI

func (MapSI) Value

func (this MapSI) Value() (driver.Value, error)

type MapSiSlice

type MapSiSlice []MapSI

func (*MapSiSlice) Append

func (this *MapSiSlice) Append(m ...MapSI)

func (*MapSiSlice) AppendMap

func (this *MapSiSlice) AppendMap(m ...map[string]interface{})

func (MapSiSlice) Get

func (this MapSiSlice) Get(key string) (value interface{}, ok bool)

func (MapSiSlice) GetMap

func (this MapSiSlice) GetMap(key string) (value Map, ok bool)

func (MapSiSlice) GetMapS

func (this MapSiSlice) GetMapS(key string) (value MapSI, ok bool)

func (MapSiSlice) Has

func (this MapSiSlice) Has(key string) (ok bool)

type MapUnmarshaler

type MapUnmarshaler interface {
	UnmarshalMap(value interface{}) (err error)
}

type SyncedMap

type SyncedMap struct {
	Data Map
	// contains filtered or unexported fields
}

func Diff

func Diff(a, b map[string]interface{}, sameA bool) (add, del, same SyncedMap)

func (*SyncedMap) Del

func (this *SyncedMap) Del(key ...interface{})

func (SyncedMap) Get

func (this SyncedMap) Get(key interface{}) (value interface{}, ok bool)

func (SyncedMap) GetBool

func (this SyncedMap) GetBool(key interface{}, defaul ...bool) bool

func (*SyncedMap) GetDel

func (this *SyncedMap) GetDel(key interface{}) (value interface{}, ok bool)

func (SyncedMap) GetInt

func (this SyncedMap) GetInt(key interface{}, defaul ...int) int

func (SyncedMap) GetInterface

func (this SyncedMap) GetInterface(key string, defaul ...interface{}) interface{}

func (SyncedMap) GetSlice

func (this SyncedMap) GetSlice(key interface{}, defaul ...[]interface{}) (r []interface{})

func (SyncedMap) GetString

func (this SyncedMap) GetString(key interface{}, defaul ...string) string

func (SyncedMap) GetStrings

func (this SyncedMap) GetStrings(key interface{}, defaul ...[]string) (r []string)

func (SyncedMap) Has

func (this SyncedMap) Has(key ...interface{}) bool

func (SyncedMap) MustGetInterface

func (this SyncedMap) MustGetInterface(key interface{}, defaul ...interface{}) interface{}

func (*SyncedMap) Set

func (this *SyncedMap) Set(key interface{}, value interface{}) *SyncedMap

func (*SyncedMap) Update

func (this *SyncedMap) Update(values ...map[string]interface{}) *SyncedMap

Jump to

Keyboard shortcuts

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