Documentation ¶
Index ¶
- Variables
- func ParseBool(s string) bool
- func ParseFloat64(s string) (float64, bool)
- func ParseInt64(s string) (int64, bool)
- func ParseStringToStringMap(val string, kkSep, kvSep string) map[string]string
- func RegisterStringParser(typ reflect.Type, parser StringParser)
- func Set(dstStructPtr interface{}, valueGenerator func(reflect.StructField) string)
- func SetField(f reflect.Value, v string)
- type StringParser
- type Updater
Constants ¶
This section is empty.
Variables ¶
View Source
var StringParserMap = map[reflect.Type]StringParser{}
StringParserMap is the map from reflect type to a string parser.
View Source
var UpdaterType = reflect.TypeOf((*Updater)(nil)).Elem()
UpdaterType is the reflect type of Assigner interface.
Functions ¶
func ParseFloat64 ¶
ParseFloat64 parses string s as float64.
func ParseStringToStringMap ¶
ParseStringToStringMap parses a string to string map from a string.
func RegisterStringParser ¶
func RegisterStringParser(typ reflect.Type, parser StringParser)
RegisterStringParser registers a string parser to a reflect type.
func Set ¶
func Set(dstStructPtr interface{}, valueGenerator func(reflect.StructField) string)
Set set struct fields by valueGenerator.
Types ¶
type StringParser ¶
StringParser is the func prototype to parse a string s to a reflect value.
Click to show internal directories.
Click to hide internal directories.