conf

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 7 Imported by: 0

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")
}

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL