+
Skip to content
/ config Public

Configuration helpers, compatible with the EVO library's Configurer interface but generic enough for other projects.

License

Notifications You must be signed in to change notification settings

klokare/config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

config MIT LicenceCoverage Status GoDoc

Helpers useful for configuring Go structs.

Original conceived to provide alternative ways for configuring experiments in evo, this package exists outside that library for two reasons:

  1. To keep the evo library itself as independent as possible
  2. To provide this functionality without requiring the full evo source

Install

To start using the config library, install Go and run go get:

$ go get github.com/klokare/config/...

Usage

Each helper provides its own New method(s). Some rely on an io.Reader for the source configuration, others might use environment variables, SQL databases, or key-value stores. Once instantiated, though, the use will be the same:

// Create the new configurer
var cfg *json.Configurer
if cfg, err = json.NewFromFile("example.json"); err != nil {
    ...
}

// Configure other components
var baker   Baker
var butcher Butcher
var maker   candlestick.Maker
if err = cfg.Configure(&baker, &butcher, &maker); err != nil {
    ...
}

About

Configuration helpers, compatible with the EVO library's Configurer interface but generic enough for other projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载