Documentation ¶
Index ¶
- func FileExists(path_ string) (bool, error)
- func LoadJsonFile(filePath string) (map[string]interface{}, error)
- func MapToStruct(m map[string]interface{}, s interface{})
- func NamedRegexpGroup(str string, reg *regexp.Regexp) (ng map[string]string, matched bool)
- func SnakeCasedName(name string) string
- func StructName(s interface{}) string
- func StructToMap(s interface{}) map[string]interface{}
- func StructToSnakeKeyMap(s interface{}) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadJsonFile ¶
load json file to a map
func NamedRegexpGroup ¶
match regexp with string, and return a named group map Example:
regexp: "(?P<name>[A-Za-z]+)-(?P<age>\\d+)" string: "CGC-30" return: map[string]string{ "name":"CGC", "age":"30" }
func SnakeCasedName ¶
convert like this: "HelloWorld" to "hello_world"
func StructToSnakeKeyMap ¶
func StructToSnakeKeyMap(s interface{}) map[string]interface{}
convert struct to map but struct's field name to snake cased map key
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.