config

package
v0.0.0-...-ef924d7 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package config implements logic to load dynamic configuration from various sources It also defines environment specific configuraton (dev, prod, ...)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapters

func Adapters() []string

Adapters returns the list of registered adapters

func NewStore

func NewStore(configStoreURI string) (store.Store, error)

NewStore returns a loaded config store defined by the ConfigStorage env

func Register

func Register(name string, adapter store.Adapter)

Register makes a store adapter available by the provided name. If an adapter is registered twice or if an adapter is nil, it will panic.

func ValueOf

func ValueOf(s string) string

ValueOf extracts the environment variable name given or the plain string given

e.g. foo -> foo

$DATABASE_URL -> http://foo.bar:8083

Types

type Config

type Config struct {
	Log   Log         `json:"log"`
	Stats Stats       `json:"stats"`
	App   interface{} `json:"app"`
}

Config defines the app config

type Log

type Log struct {
	Level  string            `json:"level"`
	Output string            `json:"output"`
	Config map[string]string `json:"config"`
}

Log contains all log-related configuration

type Stats

type Stats struct {
	On      bool              `json:"on"`
	Adapter string            `json:"adapter"`
	Config  map[string]string `json:"config"`
}

Stats contains all stats-related configuration

Directories

Path Synopsis
etcd
Package etcd reads configuration from etcd
Package etcd reads configuration from etcd
file
Package file reads configuration from a JSON file
Package file reads configuration from a JSON file

Jump to

Keyboard shortcuts

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