Documentation ¶
Overview ¶
Package config implements configuration file support for Sleepy. The files are loaded using Load and parsed using the various parsing methods.
Index ¶
- type Config
- func (c *Config) B(section, option string) bool
- func (c *Config) Bool(section, option string) (bool, error)
- func (c *Config) F(section, option string) float64
- func (c *Config) Float(section, option string) (float64, error)
- func (c *Config) I(section, option string) int64
- func (c *Config) Int(section, option string) (int64, error)
- func (c *Config) S(section, option string) string
- func (c *Config) String(section, option string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config represents a parsed configuration file.
func Load ¶
Load reads the configuration file located in 'conf' and returns a new Config type. If the configuration file cannot be found, the function returns nil and an error message.
func Merge ¶
Merge merges two or more configuration files, and returns a new, combined *Config type. Identical sections and options are overwritten according to the order of definition.
func (*Config) Bool ¶
Bool returns a value of 'option' in 'section' as an boolean. It returns 'false' along with an error message on failure.
func (*Config) Float ¶
Float returns a value of 'option' in 'section' as an float64. It returns 0.0 along with an error message on failure.
func (*Config) Int ¶
Int returns a value of 'option' in 'section' as an integer. It returns a zero (0) integer along with an error message on failure.