Documentation ¶
Index ¶
- func ParseBool(val interface{}) (value bool, err error)
- type Config
- func (c *Config) Bool(key string) (bool, error)
- func (c *Config) DIY(key string) (v interface{}, err error)
- func (c *Config) DefaultInt(key string, defaultval int) int
- func (c *Config) GetOriginMap() map[string]interface{}
- func (c *Config) GetSection(key string) (map[interface{}]interface{}, error)
- func (c *Config) GetStruct(key string, out interface{}) error
- func (c *Config) Int(key string) (int, error)
- func (c *Config) Int64(key string) (int64, error)
- func (c *Config) ReplacePlaceHolder(placeHolders map[string]interface{})
- func (c *Config) String(key string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfigFromFile ¶
NewConfigFromFile parse config from file.
func (*Config) DefaultInt ¶
DefaultInt returns the integer value for a given key. if err != nil return defaltval
func (*Config) GetOriginMap ¶
GetOriginMap : get origin configs map
func (*Config) GetSection ¶
GetSection returns map for the given key
func (*Config) ReplacePlaceHolder ¶
ReplacePlaceHolder will replace all palceholders like '${key}', replace 'key' to 'value' according to the properties map.
Click to show internal directories.
Click to hide internal directories.