Skip to content

activatedio/cs

Repository files navigation

CS

This is a new library aiming to simplify runtime configuration for Go applications. Expect more updates shortly.

GitHub Workflow Status Go Report Card

CS

CS - Config Source - Runtime library for flexible configuration.

Install

go get -u github.com/activatedio/cs

Usage

The following example shows how to create a new config, add sources, and retrieve values

cfg := cs.New()

cfg.AddSource(cs.FromYAMLFile("cs.yaml"))
// Can be strings, maps or structs
cfg.AddSource(cs.FromValue("prefix.key", "value"))
cfg.AddLateBindingSource(cs.FromEnvironmentVars())

// Read reads value
var val *string
err := cs.Read("prefix.key", val)

// MustRead does the same but panics on error
//var val *string
//cs.MustRead("prefix.key", val)


fmt.Println(val)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages