Documentation ¶
Index ¶
- Constants
- Variables
- func Bind(keys string, ret interface{}) bool
- func BindWith(keys string, f BindFunc) (interface{}, bool)
- func Elem(val interface{}, key string) (ret interface{}, ok bool)
- func ElemBool(val interface{}, key string) (ret bool, ok bool)
- func ElemDuration(val interface{}, key string) (ret time.Duration, ok bool)
- func ElemFloat64(val interface{}, key string) (ret float64, ok bool)
- func ElemInt(val interface{}, key string) (ret int, ok bool)
- func ElemInt64(val interface{}, key string) (ret int64, ok bool)
- func ElemMap(val interface{}, key string) (ret map[string]interface{}, ok bool)
- func ElemSlice(val interface{}, key string) (ret []interface{}, ok bool)
- func ElemString(val interface{}, key string) (ret string, ok bool)
- func ElemStringMap(val interface{}, key string) (ret map[string]string, ok bool)
- func ElemStringSlice(val interface{}, key string) (ret []string, ok bool)
- func ElemTime(val interface{}, key string) (ret time.Time, ok bool)
- func Evaluate(val string) string
- func FirstPrivIpv4() string
- func Get(keys string) (interface{}, bool)
- func GetBool(keys string) (bool, bool)
- func GetDuration(keys string) (time.Duration, bool)
- func GetFloat64(keys string) (float64, bool)
- func GetInt(keys string) (int, bool)
- func GetInt64(keys string) (int64, bool)
- func GetMap(keys string) (map[string]interface{}, bool)
- func GetSlice(keys string) ([]interface{}, bool)
- func GetString(keys string) (string, bool)
- func GetStringMap(keys string) (map[string]string, bool)
- func GetStringSlice(keys string) ([]string, bool)
- func GetTime(keys string) (time.Time, bool)
- func InitConf(vs map[string]interface{})
- func LoadConf(env string, name string) (bs []byte, path string, err error)
- func MarshalToml(vl interface{}) (bs []byte, err error)
- func MustBind(keys string, ret interface{})
- func MustBool(keys string) bool
- func MustDuration(keys string) time.Duration
- func MustFloat64(keys string) float64
- func MustInt(keys string) int
- func MustInt64(keys string) int64
- func MustMap(keys string) map[string]interface{}
- func MustSlice(keys string) []interface{}
- func MustString(keys string) string
- func MustStringMap(keys string) map[string]string
- func MustStringSlice(keys string) []string
- func MustTime(keys string) time.Time
- func OptiBool(keys string, def bool) bool
- func OptiDuration(keys string, def time.Duration) time.Duration
- func OptiFloat64(keys string, def float64) float64
- func OptiInt(keys string, def int) int
- func OptiInt64(keys string, def int64) int64
- func OptiMap(keys string, def map[string]interface{}) map[string]interface{}
- func OptiSlice(keys string, def []interface{}) []interface{}
- func OptiString(keys string, def string) string
- func OptiStringMap(keys string, def map[string]string) map[string]string
- func OptiStringSlice(keys string, def []string) []string
- func OptiTime(keys string, def time.Time) time.Time
- func ToBool(val interface{}) bool
- func ToDuration(val interface{}) time.Duration
- func ToFloat64(val interface{}) float64
- func ToInt(val interface{}) int
- func ToInt64(val interface{}) int64
- func ToMap(val interface{}) map[string]interface{}
- func ToSlice(val interface{}) []interface{}
- func ToString(val interface{}) string
- func ToStringMap(val interface{}) map[string]string
- func ToStringSlice(val interface{}) []string
- func ToTime(val interface{}) time.Time
- type BindFunc
Constants ¶
View Source
const ( CONF_TOML_FILE string = "conf.toml" PATH_STEP_SEP byte = '.' CONF_TOML_ENV string = "CONF_TOML" LAYOUT_DATE string = "2006-01-02" LAYOUT_TIME string = "15:04:05" LAYOUT_DATETIME string = "2006-01-02 15:04:05" LAYOUT_DATETIME_T string = "2006-01-02T15:04:05" LENGTH_DATETIME = len(LAYOUT_DATETIME) )
Variables ¶
View Source
var ZERO_TIME = time.Unix(0, 0)
Functions ¶
func ElemFloat64 ¶
func ElemString ¶
func ElemStringMap ¶
func ElemStringSlice ¶
func FirstPrivIpv4 ¶
func FirstPrivIpv4() string
func GetFloat64 ¶
func GetStringSlice ¶
func MarshalToml ¶
需要对称marshal为toml才能进行对称解析, 否则tag里面的toml:...会失败
func MustDuration ¶
func MustFloat64 ¶
func MustString ¶
func MustStringMap ¶
func MustStringSlice ¶
func OptiFloat64 ¶
func OptiString ¶
func OptiStringSlice ¶
func ToDuration ¶
func ToStringMap ¶
func ToStringSlice ¶
func ToStringSlice(val interface{}) []string
Types ¶
Click to show internal directories.
Click to hide internal directories.