README ¶ Пакет конфигурации приложения Документация: [[https://wiki.leolab.info/prj/libs/go/conf/]] Использование import "git.leolab.info/lib/conf" func main(){ cfg,err:=conf.New() if err!=nil{ panic(err) } v1:=cfg.Val("path.to.key") vInt,err:=cfg.Val("path.to.ketInt") } Expand ▾ Collapse ▴ Documentation ¶ Index ¶ type Conf func New(files ...string) (cfg *Conf, err error) func (c *Conf) Bool(key string) (bool, error) func (c *Conf) Duration(key string) (time.Duration, error) func (c *Conf) Exists(key string) bool func (c *Conf) Float(key string) (float64, error) func (c *Conf) Int(key string) (int, error) func (c *Conf) Val(key string) string Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Conf ¶ type Conf struct { Args map[string]string //Параметры из файлов и запуска Cmds []string //Команды запуска } func New ¶ func New(files ...string) (cfg *Conf, err error) func (*Conf) Bool ¶ func (c *Conf) Bool(key string) (bool, error) func (*Conf) Duration ¶ func (c *Conf) Duration(key string) (time.Duration, error) func (*Conf) Exists ¶ func (c *Conf) Exists(key string) bool Существуеет ли ключ func (*Conf) Float ¶ func (c *Conf) Float(key string) (float64, error) func (*Conf) Int ¶ func (c *Conf) Int(key string) (int, error) func (*Conf) Val ¶ func (c *Conf) Val(key string) string Source Files ¶ View all Source files conf.go types.go Click to show internal directories. Click to hide internal directories.