Documentation ¶
Index ¶
- Variables
- func GetBool(path string, defaultval bool) bool
- func GetDuration(path string, defaultval time.Duration) time.Duration
- func GetInt64(path string, defaultval int64) int64
- func GetObject(path string, v interface{}) error
- func GetString(path string, defaultval string) string
- func Has(path string) bool
- func Load(source []byte)
- func LoadFromFile(filepath string) error
- type Config
- func (config *Config) Get(path string) Value
- func (config *Config) GetBool(path string, defaultval bool) bool
- func (config *Config) GetConfig(path string) *Config
- func (config *Config) GetDuration(path string, defaultval time.Duration) time.Duration
- func (config *Config) GetInt64(path string, defaultval int64) int64
- func (config *Config) GetObject(path string, v interface{}) error
- func (config *Config) GetString(path string, defaultval string) string
- func (config *Config) Has(path string) bool
- func (config *Config) Reload(source []byte) error
- func (config *Config) String() string
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobalConfig = config
GlobalConfig global builtin config
Functions ¶
func GetDuration ¶
GetDuration get config value as Int
func LoadFromFile ¶
LoadFromFile load config from config json file
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config golang json config object
func NewFromFile ¶
NewFromFile load config from json file
func (*Config) GetDuration ¶
GetDuration fetch config value as time.Duration
Click to show internal directories.
Click to hide internal directories.