omap

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT 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 @Description: 在map里深层搜索 @param m @param paths @return map[string]interface{}

func InsensitiviseMap

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

InsensitiviseMap @Description:insensitivise map @param m

func MergeStringMap

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

MergeStringMap @Description: 合并2个map @param dest @param src

func ToMapStringInterface

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

ToMapStringInterface @Description:将map[interface{}]interface{}转换为map[string]interface{} @param src @return map[string]interface{}

Types

type FlatMap

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

FlatMap @Description:

func NewFlatMap

func NewFlatMap() *FlatMap

NewFlatMap @Description: @return *FlatMap

func (*FlatMap) Get

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

Get @Description: 返回键的值 @receiver flat @param key @return interface{}

func (*FlatMap) GetBool

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

GetBool @Description: 以bool形式返回键的值 @receiver flat @param key @return bool

func (*FlatMap) GetDuration

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

GetDuration @Description: 以time.Duration形式返回键的值 @receiver flat @param key @return time.Duration

func (*FlatMap) GetFloat64

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

GetFloat64 @Description: 以float64形式返回键的值 @receiver flat @param key @return float64

func (*FlatMap) GetInt

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

GetInt @Description: 以int形式返回键的值 @receiver flat @param key @return int

func (*FlatMap) GetInt64

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

GetInt64 @Description: 以int64形式返回键的值 @receiver flat @param key @return int64

func (*FlatMap) GetSlice

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

GetSlice @Description: 以[]interface{}形式返回键的值 @receiver flat @param key @return []interface{}

func (*FlatMap) GetSliceStringMap

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

GetSliceStringMap @Description: 以[]map[string]interface{}形式返回键的值 @receiver flat @param key @return []map[string]interface{}

func (*FlatMap) GetString

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

GetString @Description: 以string形式返回键的值 @receiver flat @param key @return string

func (*FlatMap) GetStringMap

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

GetStringMap @Description: 以map[string]interface{}形式返回键的值 @receiver flat @param key @return map[string]interface{}

func (*FlatMap) GetStringMapString

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

GetStringMapString @Description: 以map[string]string形式返回键的值 @receiver flat @param key @return map[string]string

func (*FlatMap) GetStringMapStringSlice

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

GetStringMapStringSlice @Description:以map[string][]string形式返回键的值 @receiver flat @param key @return map[string][]string

func (*FlatMap) GetStringSlice

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

GetStringSlice @Description: 以[]string形式返回键的值 @receiver flat @param key @return []string

func (*FlatMap) GetTime

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

GetTime @Description: 以time.Time形式返回键的值 @receiver flat @param key @return time.Time

func (*FlatMap) Load

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

Load @Description: @receiver flat @param content @param unmarshal @return error

func (*FlatMap) Reset

func (flat *FlatMap) Reset()

Reset @Description: @receiver flat

func (*FlatMap) Set

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

Set @Description: 设置键的值 @receiver flat @param key @param val @return error

func (*FlatMap) UnmarshalKey

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

UnmarshalKey @Description:获取单个键并将其解组到Struct中 @receiver flat @param key @param rawVal @param tagName @return error

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