Documentation
¶
Index ¶
- type Config
- func (c *Config) Get(key string) (interface{}, error)
- func (c *Config) GetBool(key string) (bool, error)
- func (c *Config) GetBoolArray(key string) ([]bool, error)
- func (c *Config) GetDefaultBool(key string, defaultVal bool) bool
- func (c *Config) GetDefaultBoolArray(key string, defaultVal []bool) []bool
- func (c *Config) GetDefaultFloat(key string, defaultVal float64) float64
- func (c *Config) GetDefaultFloatArray(key string, defaultVal []float64) []float64
- func (c *Config) GetDefaultInt(key string, defaultVal int) int
- func (c *Config) GetDefaultIntArray(key string, defaultVal []int) []int
- func (c *Config) GetDefaultMap(key string, defaultVal map[string]interface{}) map[string]interface{}
- func (c *Config) GetDefaultString(key string, defaultVal string) string
- func (c *Config) GetDefaultStringArray(key string, defaultVal []string) []string
- func (c *Config) GetFloat(key string) (float64, error)
- func (c *Config) GetFloatArray(key string) ([]float64, error)
- func (c *Config) GetInt(key string) (int, error)
- func (c *Config) GetIntArray(key string) ([]int, error)
- func (c *Config) GetMap(key string) (map[string]interface{}, error)
- func (c *Config) GetString(key string) (string, error)
- func (c *Config) GetStringArray(key string) ([]string, error)
- func (c *Config) GetSubKeys(key string) ([]string, error)
- func (c *Config) Len(key string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Delimiter string // contains filtered or unexported fields }
func FromString ¶
FromString create a config by specified yaml string.
func (*Config) Get ¶
Get returns the interface{} value for a given key. Support multi-level key which concat with '.'.
func (*Config) GetBoolArray ¶
GetBoolArray returns the []bool value for a given key.
func (*Config) GetDefaultBool ¶
GetDefaultBool returns the boolean value for a given key. if error occur, return defaultVal
func (*Config) GetDefaultBoolArray ¶
GetDefaultBoolArray returns the []bool value for a given key. if error occur, return defaultVal
func (*Config) GetDefaultFloat ¶
GetDefaultFloat returns the float64 value for a given key. if error occur, return defaultVal
func (*Config) GetDefaultFloatArray ¶
GetDefaultFloatArray returns the []float64 value for a given key. if error occur, return defaultVal
func (*Config) GetDefaultInt ¶
GetDefaultInt returns the int value for a given key. if error occur, return defaultVal
func (*Config) GetDefaultIntArray ¶
GetDefaultIntArray returns the []int value for a given key. if error occur, return defaultVal
func (*Config) GetDefaultMap ¶
func (c *Config) GetDefaultMap(key string, defaultVal map[string]interface{}) map[string]interface{}
GetDefaultMap returns the map[string]interface{} value for a given key. if error occur, return defaultVal
func (*Config) GetDefaultString ¶
GetDefaultString returns the string value for a given key. if error occur, return defaultVal
func (*Config) GetDefaultStringArray ¶
GetDefaultStringArray returns the []string value for a given key. if error occur, return defaultVal
func (*Config) GetFloatArray ¶
GetFloatArray returns the []float64 value for a given key.
func (*Config) GetIntArray ¶
GetIntArray returns the []int value for a given key.
func (*Config) GetStringArray ¶
GetStringArray returns the []string value for a given key.
func (*Config) GetSubKeys ¶
GetSubKeys returns the subkey array of a given key. Support multi-level key which concat with '.'.