Documentation ¶
Overview ¶
dict is a helper function that allow one to easily get concreate values out of a map[string]interface{}
Index ¶
- func ParseBool(v interface{}) (*bool, error)
- func ParseBoolSlice(val string) ([]bool, error)
- func ParseFloat(v interface{}) (*float64, error)
- func ParseFloatSlice(val string) ([]float64, error)
- func ParseInt(v interface{}) (*int, error)
- func ParseIntSlice(val string) ([]int, error)
- func ParseString(v interface{}) (*string, error)
- func ParseStringSlice(val string) ([]string, error)
- func ParseUint(v interface{}) (*uint, error)
- func ParseUintSlice(val string) ([]uint, error)
- type Bool
- type Dict
- func (d Dict) Bool(key string, def *bool) (v bool, err error)
- func (d Dict) BoolSlice(key string) (v []bool, err error)
- func (d Dict) Dict(key string) (v Dict, err error)
- func (d Dict) Float(key string, def *float64) (v float64, err error)
- func (d Dict) FloatSlice(key string) (v []float64, err error)
- func (d Dict) Int(key string, def *int) (v int, err error)
- func (d Dict) IntSlice(key string) (v []int, err error)
- func (d Dict) Interface(key string) (v interface{}, ok bool)
- func (d Dict) Map(key string) (r dict.Dicter, err error)
- func (d Dict) MapSlice(key string) (r []dict.Dicter, err error)
- func (d Dict) String(key string, def *string) (v string, err error)
- func (d Dict) StringSlice(key string) (v []string, err error)
- func (d Dict) Uint(key string, def *uint) (v uint, err error)
- func (d Dict) UintSlice(key string) (v []uint, err error)
- type ErrEnvVar
- type ErrType
- type Float
- type Int
- type String
- type Uint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseBoolSlice ¶
func ParseFloat ¶
func ParseFloatSlice ¶
func ParseIntSlice ¶
func ParseString ¶
func ParseStringSlice ¶
func ParseUintSlice ¶
Types ¶
type Dict ¶
type Dict map[string]interface{}
func (Dict) Bool ¶
Bool returns the value as a string type, if it is unable to convert the value it will error. If the default value is not provided, and it can not find the value, it will return the zero value, and an error.
func (Dict) Dict ¶
Dict is to obtain a map[string]interface{} that has already been cast to a M type.
func (Dict) Float ¶
Float returns the value as a uint type, if it is unable to convert the value it will error. If the default value is not provided, and it can not find the value, it will return the zero value, and an error.
func (Dict) Int ¶
Int returns the value as a int type, if it is unable to convert the value it will error. If the default value is not provided, and it can not find the value, it will return the zero value, and an error.
func (Dict) String ¶
String returns the value as a string type, if it is unable to convert the value it will error. If the default value is not provided, and it can not find the value, it will return the zero value, and an error.
type ErrType ¶
type ErrType struct {
// contains filtered or unexported fields
}
ErrType corresponds with an incorrect type passed to UnmarshalTOML