Documentation
¶
Index ¶
- type Config
- func (c *Config) Fetch(args ...interface{}) string
- func (c *Config) Get(args ...interface{}) string
- func (c *Config) GetConf(args ...interface{}) string
- func (c *Config) GetEnv(args ...interface{}) string
- func (c *Config) GetSection(section string) Section
- func (c *Config) Getenv(key interface{}) string
- func (c *Config) Getkey(key interface{}) string
- func (c *Config) List() []string
- func (c *Config) Put(args ...interface{})
- func (c *Config) Save()
- func (c *Config) Setenv(key, value interface{})
- type Section
- func (sec *Section) Fetch(args ...interface{}) string
- func (sec *Section) Get(args ...interface{}) string
- func (sec *Section) GetConf(args ...interface{}) string
- func (sec *Section) GetEnv(args ...interface{}) string
- func (sec *Section) Getenv(key interface{}) string
- func (sec *Section) Getkey(key interface{}) string
- func (sec *Section) List() []string
- func (sec *Section) Put(args ...interface{})
- func (sec *Section) Setenv(key, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config struct has map to contains secions and an attribute to indicate the current section
func (*Config) Fetch ¶
Get key values from config
At least the key name should be provided ¶
Parameter sets: conf_key
Parameter sets: conf_key, env_key
Parameter sets: conf_key, env_key, default_value
When env_key is provided it will try to fetch env variable only if the value of conf_key is empty
func (*Config) Get ¶
Get key values from config
At least the key name should be provided ¶
Parameter sets: conf_key
Parameter sets: env_key, conf_key
Parameter sets: env_key, conf_key, default_value
When env_key is provided it will try to fetch env variable first, if it's empty, it will try to get it from config
func (*Config) GetConf ¶
Get key values from config
At least the key name should be provided ¶
Parameter sets: conf_key
Parameter sets: conf_key, default_value
func (*Config) GetEnv ¶
Get key values from env
At least the key name should be provided ¶
Parameter sets: env_key
Parameter sets: env_key, default_value
func (*Config) GetSection ¶
Get config section with name
type Section ¶
type Section map[string]interface{}
Section is a based on map
func (*Section) Get ¶
Get config key, args pattern: envKey, configKey, defaultValue or just configKey