Documentation ¶
Overview ¶
Package Env allows developers to use the consul(https://github.com/hashicorp/consul) api as a storage for environment variables.
At the production level this package abstracts out the consul.KV() api and at the dev level it abstracts out the core `os` package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
DefaultConfig() abstracts out the api.DefaultConfig call entirely. This is so in default usecases you will only ever need to import this one package. Obviously if you require more power you have the ability to import github.com/hashicorp/consul/api and configure your client as needed.
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
func New ¶
New is used to return a new instance of a KV() consul client. It is provided a config to create the client. No default namespace is used.
func (Env) List ¶
List calls the consul.List() method to retrieve all values from a particular namespace. For backwards compatability, each KV Pair is formatted to match a standard k=v as per os.Environ.
func (Env) SetNamespace ¶
Namespace allows you to set and change the namespace.