xmap

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeySpliter = "."

KeySpliter ...

Functions

func DeepSearchInMap

func DeepSearchInMap(m map[string]interface{}, paths ...string) map[string]interface{}

DeepSearchInMap deep search in map

func InsensitiviseMap

func InsensitiviseMap(m map[string]interface{})

InsensitiviseMap insensitivise map

func MergeStringMap

func MergeStringMap(dest, src map[string]interface{})

MergeStringMap merge two map

func ToMapStringInterface

func ToMapStringInterface(src map[interface{}]interface{}) map[string]interface{}

ToMapStringInterface cast map[interface{}]interface{} to map[string]interface{}

Types

type FlatMap

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

FlatMap ...

func NewFlatMap

func NewFlatMap() *FlatMap

NewFlatMap ...

func (*FlatMap) Get

func (flat *FlatMap) Get(key string) interface{}

Get returns the value associated with the key

func (*FlatMap) GetBool

func (flat *FlatMap) GetBool(key string) bool

GetBool returns the value associated with the key as a boolean.

func (*FlatMap) GetDuration

func (flat *FlatMap) GetDuration(key string) time.Duration

GetDuration returns the value associated with the key as a duration.

func (*FlatMap) GetFloat64

func (flat *FlatMap) GetFloat64(key string) float64

GetFloat64 returns the value associated with the key as a float64.

func (*FlatMap) GetInt

func (flat *FlatMap) GetInt(key string) int

GetInt returns the value associated with the key as an integer.

func (*FlatMap) GetInt64

func (flat *FlatMap) GetInt64(key string) int64

GetInt64 returns the value associated with the key as an integer.

func (*FlatMap) GetSlice

func (flat *FlatMap) GetSlice(key string) []interface{}

GetSlice returns the value associated with the key as a slice of strings.

func (*FlatMap) GetSliceStringMap

func (flat *FlatMap) GetSliceStringMap(key string) []map[string]interface{}

GetSliceStringMap returns the value associated with the slice of maps.

func (*FlatMap) GetString

func (flat *FlatMap) GetString(key string) string

GetString returns the value associated with the key as a string.

func (*FlatMap) GetStringMap

func (flat *FlatMap) GetStringMap(key string) map[string]interface{}

GetStringMap returns the value associated with the key as a map of interfaces.

func (*FlatMap) GetStringMapString

func (flat *FlatMap) GetStringMapString(key string) map[string]string

GetStringMapString returns the value associated with the key as a map of strings.

func (*FlatMap) GetStringMapStringSlice

func (flat *FlatMap) GetStringMapStringSlice(key string) map[string][]string

GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings.

func (*FlatMap) GetStringSlice

func (flat *FlatMap) GetStringSlice(key string) []string

GetStringSlice returns the value associated with the key as a slice of strings.

func (*FlatMap) GetTime

func (flat *FlatMap) GetTime(key string) time.Time

GetTime returns the value associated with the key as time.

func (*FlatMap) Load

func (flat *FlatMap) Load(content []byte, unmarshal Unmarshaller) error

Load ...

func (*FlatMap) Reset

func (flat *FlatMap) Reset()

Reset ...

func (*FlatMap) Set

func (flat *FlatMap) Set(key string, val interface{}) error

Set ...

func (*FlatMap) UnmarshalKey

func (flat *FlatMap) UnmarshalKey(key string, rawVal interface{}, tagName string) error

UnmarshalKey takes a single key and unmarshal it into a Struct.

type Unmarshaller

type Unmarshaller = func([]byte, interface{}) error

Unmarshaller ...

Jump to

Keyboard shortcuts

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