Documentation
¶
Index ¶
- Constants
- func IsZero(i interface{}) bool
- func MapKeys(m map[string]interface{}) []string
- func Pretty(v interface{}) []byte
- func PrettyColor(v interface{}) []byte
- func PrettyColorStr(v interface{}) string
- func PrettyStr(v interface{}) string
- func StringsContains(strSlice []string, str string) bool
- func StringsContainsFold(strSlice []string, str string) bool
- func StructTag(v interface{}, fieldName, key string) string
- func StructTags(v interface{}, key string) ([]string, error)
- func StructToMap(v interface{}) (map[string]interface{}, error)
- func StructToMapTag(v interface{}, key string) (map[string]interface{}, error)
Constants ¶
View Source
const ( JsonTag = "json" DbTag = "db" YamlTag = "yaml" TomlTag = "toml" )
list of known struct tag key
Variables ¶
This section is empty.
Functions ¶
func IsZero ¶
func IsZero(i interface{}) bool
IsZero return true if given parameter is set to zero value
func PrettyColorStr ¶
func PrettyColorStr(v interface{}) string
PrettyColorStr convert type to JSON with color
func StringsContains ¶
StringsContains check wether str is in the slice
func StringsContainsFold ¶
StringsContainsFold check wether str is in the slice
func StructTags ¶
StructTags list tags for given data
func StructToMap ¶
StructToMap expands struct/map to map[string]interface{} If v already a map, it simply return v
func StructToMapTag ¶
StructToMapTag expands struct/map to map[string]interface{} If v already a map, it simply return v
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.