Documentation ¶
Overview ¶
Config Package.
package main import "github.com/ije/gox/config" func main() { conf, err := config.New("a.conf") if err != nil { return } log.Printf(conf.String("key", "defaultValue")) log.Printf(conf.Section("sectionName").String("key", "defaultValue")) }
Index ¶
- type Config
- func (config *Config) Bool(key string, def ...bool) bool
- func (config *Config) Bytes(key string, def ...int64) int64
- func (config *Config) Contains(key string) bool
- func (config *Config) Each(hanlder func(key string, value string))
- func (config *Config) ExtendedSections() map[string]Section
- func (config *Config) Float64(key string, def ...float64) float64
- func (config *Config) Int(key string, def ...int) int
- func (config *Config) Int64(key string, def ...int64) int64
- func (config *Config) IsEmpty() bool
- func (config *Config) Keys() []string
- func (config *Config) Section(name string) (section Section)
- func (config *Config) Set(key string, value interface{})
- func (config *Config) String(key string, extra ...string) string
- type Section
- func (section Section) Bool(key string, extra ...bool) bool
- func (section Section) Bytes(key string, extra ...int64) int64
- func (section Section) Contains(key string) (ok bool)
- func (section Section) Each(hanlder func(key string, value string))
- func (section Section) Float64(key string, extra ...float64) float64
- func (section Section) Int(key string, extra ...int) int
- func (section Section) Int64(key string, extra ...int64) int64
- func (section Section) IsEmpty() bool
- func (section Section) Keys() (keys []string)
- func (section Section) Set(key string, value interface{})
- func (section Section) String(key string, extra ...string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) ExtendedSections ¶
Click to show internal directories.
Click to hide internal directories.