Documentation
¶
Index ¶
- func FormatIndent(mp interface{}, indent string) string
- func GetByPath(key string, mp map[string]interface{}) (val interface{}, ok bool)
- func HttpQueryString(data map[string]interface{}) string
- func KeyToLower(src map[string]string) map[string]string
- func Keys(mp interface{}) (keys []string)
- func MergeStringMap(src, dst map[string]string, ignoreCase bool) map[string]string
- func ToString(mp map[string]interface{}) string
- func ToString2(mp interface{}) string
- func ToStringMap(src map[string]interface{}) map[string]string
- func Values(mp interface{}) (values []interface{})
- type Aliases
- type Data
- func (d Data) Bool(key string) bool
- func (d Data) Default(key string, def interface{}) interface{}
- func (d Data) Emtpy() bool
- func (d Data) Get(key string) interface{}
- func (d Data) GetByPath(path string) (interface{}, bool)
- func (d Data) Has(key string) bool
- func (d Data) Int(key string) int
- func (d Data) Int64(key string) int64
- func (d Data) Set(key string, val interface{})
- func (d Data) Str(key string) string
- func (d Data) String() string
- func (d Data) StringMap(key string) map[string]string
- func (d Data) Strings(key string) []string
- func (d Data) StringsByStr(key string) []string
- func (d Data) ToStringMap() map[string]string
- func (d Data) Value(key string) (interface{}, bool)
- type MapFormatter
- type SMap
- func (m SMap) Bool(key string) bool
- func (m SMap) Get(key string) string
- func (m SMap) Has(key string) bool
- func (m SMap) HasValue(val string) bool
- func (m SMap) Int(key string) int
- func (m SMap) Int64(key string) int64
- func (m SMap) Ints(key string) []int
- func (m SMap) IsEmpty() bool
- func (m SMap) Str(key string) string
- func (m SMap) String() string
- func (m SMap) Strings(key string) (ss []string)
- func (m SMap) Value(key string) (string, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatIndent ¶ added in v0.5.3
FormatIndent map data to string.
func HttpQueryString ¶ added in v0.3.9
HttpQueryString convert map[string]interface{} data to http query string.
func KeyToLower ¶
KeyToLower convert keys to lower case.
func MergeStringMap ¶
MergeStringMap simple merge two string map. merge src to dst map
func ToString ¶ added in v0.4.5
ToString simple and quickly convert map[string]interface{} to string.
func ToString2 ¶ added in v0.5.3
func ToString2(mp interface{}) string
ToString2 simple and quickly convert a map to string.
func ToStringMap ¶ added in v0.3.9
ToStringMap convert map[string]interface{} to map[string]string
Types ¶
type Aliases ¶ added in v0.3.9
Aliases implemented a simple string alias map.
func (Aliases) AddAliasMap ¶ added in v0.3.9
AddAliasMap to the Aliases
func (Aliases) AddAliases ¶ added in v0.3.9
AddAliases to the Aliases
func (Aliases) ResolveAlias ¶ added in v0.3.9
ResolveAlias by given name.
type Data ¶ added in v0.3.9
type Data map[string]interface{}
Data an map data type
func (Data) StringsByStr ¶ added in v0.5.3
StringsByStr value get by key
func (Data) ToStringMap ¶ added in v0.5.3
ToStringMap convert to map[string]string
type MapFormatter ¶ added in v0.5.3
type MapFormatter struct { common.BaseFormatter // Prefix string for each element Prefix string // Indent string for each element Indent string // ClosePrefix string for last "}" ClosePrefix string }
MapFormatter struct
func NewFormatter ¶ added in v0.5.3
func NewFormatter(mp interface{}) *MapFormatter
NewFormatter instance
func (*MapFormatter) Format ¶ added in v0.5.3
func (f *MapFormatter) Format() string
Format to string
func (*MapFormatter) FormatTo ¶ added in v0.5.3
func (f *MapFormatter) FormatTo(w io.Writer)
FormatTo to custom buffer
func (*MapFormatter) String ¶ added in v0.5.3
func (f *MapFormatter) String() string
Format to string
func (*MapFormatter) WithFn ¶ added in v0.5.3
func (f *MapFormatter) WithFn(fn func(f *MapFormatter)) *MapFormatter
WithFn for config self
func (*MapFormatter) WithIndent ¶ added in v0.5.3
func (f *MapFormatter) WithIndent(indent string) *MapFormatter
WithIndent string