config

package
v0.0.0-...-fb5617b Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package config does configuration management

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(useLocal bool, name string) http.FileSystem

Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.

func FS

func FS(useLocal bool) http.FileSystem

FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSByte

func FSByte(useLocal bool, name string) ([]byte, error)

FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSMustByte

func FSMustByte(useLocal bool, name string) []byte

FSMustByte is the same as FSByte, but panics if name is not present.

func FSMustString

func FSMustString(useLocal bool, name string) string

FSMustString is the string version of FSMustByte.

func FSString

func FSString(useLocal bool, name string) (string, error)

FSString is the string version of FSByte.

func LoadAsset

func LoadAsset(path string) http.File

LoadAsset is wrapper function to read file from asset created by http://godoc.org/github.com/mjibson/esc

func Viper

func Viper()

Viper reads in viper config by scaning paths

func ViperHard

func ViperHard()

ViperHard reads in viper config by specified file

Types

type AppContext

type AppContext struct {
	Env          string
	ProjectID    string
	SuffixOfKind string
	EtcdServers  []string
	CommonConfig *viper.Viper
}

AppContext manages application context

func (*AppContext) Load

func (ctx *AppContext) Load(env string)

Load loads config from config yaml file

Jump to

Keyboard shortcuts

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