config

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: Apache-2.0 Imports: 4 Imported by: 12

Documentation

Index

Constants

View Source
const (
	ListenAddr              = "listen-addr"
	BuildDir                = "build-dir"
	ServerTimeout           = "server-timeout"
	URI                     = "vili-uri"
	StaticLiveReload        = "static-live-reload"
	Environments            = "environments"
	ProdEnvs                = "prod-envs"
	ApprovalEnvs            = "approval-envs"
	DefaultEnv              = "default-env"
	LogDebug                = "log-debug"
	LogJSON                 = "log-json"
	RedisPort               = "redis-port"
	RedisDB                 = "redis-db"
	AuthService             = "auth-service"
	OktaEntrypoint          = "okta-entrypoint"
	OktaIssuer              = "okta-issuer"
	OktaCert                = "okta-cert"
	OktaDomain              = "okta-domain"
	GithubToken             = "github-token"
	GithubOwner             = "github-owner"
	GithubRepo              = "github-repo"
	GithubContentsPath      = "github-contents-path"
	RegistryURL             = "registry-url"
	RegistryBranchDelimiter = "registry-branch-delimiter"
	RegistryNamespace       = "registry-namespace"
	RegistryUsername        = "registry-username"
	RegistryPassword        = "registry-password"
	AWSRegion               = "aws-region"
	AWSAccessKeyID          = "aws-access-key-id"
	AWSSecretAccessKey      = "aws-secret-access-key"
	ECRAccountID            = "ecr-account-id"
	DockerMode              = "docker-mode"
	FirebaseURL             = "firebase-url"
	FirebaseSecret          = "firebase-secret"
	SlackToken              = "slack-token"
	SlackChannel            = "slack-channel"
	SlackUsername           = "slack-username"
	SlackEmoji              = "slack-emoji"
	SlackDeployUsernames    = "slack-deploy-usernames"
)

Config variables

Variables

This section is empty.

Functions

func Get

func Get(key string) interface{}

Get returns the value found for <key> by searching overrides (see Set), environment, config dir, and defaults (see SetDefault), in that order. If no value is found, returns nil.

func GetBool

func GetBool(key string) bool

GetBool is like Get but runs strconv.ParseBool on the value. Returns false if no value is found.

func GetDuration

func GetDuration(key string) time.Duration

GetDuration is like Get but runs time.ParseDuration on the value. Returns a zero-length duration if no value is found.

func GetFloat64

func GetFloat64(key string) float64

GetFloat64 is like Get but parses the value into a float64. Returns 0.0 if no value is found.

func GetInt

func GetInt(key string) int

GetInt is like Get but parses the value into an int. Returns 0 if no value is found.

func GetString

func GetString(key string) string

GetString is like Get but returns a string or "".

func GetStringMap

func GetStringMap(key string) map[string]interface{}

GetStringMap is only useful with JSON, YAML and TOML config files, which we aren't using at the moment.

func GetStringMapString

func GetStringMapString(key string) map[string]string

GetStringMapString is only useful with JSON, YAML and TOML config files, which we aren't using at the moment.

func GetStringSlice

func GetStringSlice(key string) []string

GetStringSlice is like Get but runs strings.Fields on the value. Returns an empty slice if no value is found.

func GetTime

func GetTime(key string) time.Time

GetTime is like Get but parses the value into a time.Time. It can parse RFCs 3339, 1123 and 822; ISO 8601; ANSI C, Unix, and Ruby timestamps; and the following ad hoc formats: "2006-01-02 15:04:05Z07:00", "02 Jan 06 15:04 MST", "2006-01-02", "02 Jan 2006". If no value is found, returns midnight on 1/1/1.

func GithubEnvContentsPath

func GithubEnvContentsPath(env string) string

GithubEnvContentsPath returns the config variable name for robot tokens

func Init

func Init() error

Init initializes the config

func InitApp

func InitApp() error

InitApp initializes the config

func IsSet

func IsSet(key string) bool

IsSet returns true if <key> is set via Set, in environment, config dir, or via SetDefault

func KubernetesClientCert added in v1.1.0

func KubernetesClientCert(env string) string

KubernetesClientCert returns the config variable name for robot tokens

func KubernetesClientKey added in v1.1.0

func KubernetesClientKey(env string) string

KubernetesClientKey returns the config variable name for robot tokens

func KubernetesNamespace

func KubernetesNamespace(env string) string

KubernetesNamespace returns the config variable name for robot tokens

func KubernetesURL

func KubernetesURL(env string) string

KubernetesURL returns the config variable name for robot tokens

func Require

func Require(keys ...string) error

Require returns an error if any of the specified keys aren't set

func Set

func Set(key string, value interface{})

Set assigns <value> to <key>, overriding values set in any other source

func SetDefault

func SetDefault(key string, value interface{})

SetDefault assigns <value> to <key> if it has no value in any other source

Types

This section is empty.

Jump to

Keyboard shortcuts

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