Documentation ¶
Index ¶
- Constants
- Variables
- func CopyDefaults(a, b interface{})
- func CopyFrom(a, b interface{})
- func FlattenMap(a map[string]interface{}) map[string]interface{}
- func IsEmpty(v reflect.Value) bool
- func IsZero(src interface{}) bool
- func Lookup(i interface{}, path string) (reflect.Value, error)
- func MergeMap(a interface{}, b map[string]interface{}) error
- func StructFields(src interface{}) ([]reflect.StructField, error)
- func URLMap(query string) (map[string]interface{}, error)
- func Zero(src interface{}) (interface{}, error)
Constants ¶
View Source
const ( SplitToken = "." IndexCloseChar = "]" IndexOpenChar = "[" )
Variables ¶
View Source
var ( ErrMalformedIndex = errors.New("Malformed index key") ErrInvalidIndexUsage = errors.New("Invalid index key usage") ErrKeyNotFound = errors.New("Unable to find the key") ErrBadJSONPath = errors.New("Bad path: must start with $ and have more then 2 chars") )
View Source
var ( // ErrInvalidStruct specifies invalid struct error ErrInvalidStruct = errors.New("invalid struct specified") // ErrInvalidParam specifies invalid url query params ErrInvalidParam = errors.New("invalid url query param provided") )
Functions ¶
func CopyDefaults ¶ added in v3.1.4
func CopyDefaults(a, b interface{})
CopyDefaults for a from b a and b should be pointers to the same kind of struct
func CopyFrom ¶ added in v3.1.4
func CopyFrom(a, b interface{})
CopyFrom sets the public members of a from b a and b should be pointers to structs a can be a different type from b Only the Fields which have the same name and assignable type on a and b will be set.
func FlattenMap ¶ added in v3.2.8
FlattenMap expand key.subkey to nested map
func IsZero ¶ added in v3.2.24
func IsZero(src interface{}) bool
IsZero returns true if struct is zero (not have any defined values)
func StructFields ¶ added in v3.1.4
func StructFields(src interface{}) ([]reflect.StructField, error)
StructFields returns slice of struct fields
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.