config

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvCycloneServerPort = "ENV_CYCLONE_SERVER_PORT"
	EnvCycloneServerHost = "ENV_CYCLONE_SERVER_HOST"

	EnvKubeHost   = "ENV_KUBE_HOST"
	EnvKubeConfig = "ENV_KUBE_CONFIG"

	EnvLogLevel = "ENV_LOG_LEVEL"

	DefaultCycloneServerPort int = 7099

	DefaultCycloneServerHost = "0.0.0.0"

	DefaultLogLevel = "info"
)

Variables

View Source
var (
	// listen port
	CycloneServerPort int
	// cyclone server
	CycloneServerHost string

	// k8s about
	KubeHost   string
	KubeConfig string

	// log
	LogLevel string
)

Functions

func GetStringEnvWithDefault

func GetStringEnvWithDefault(name, defaultValue string) string

GetStringEnvWithDefault retrieves the value of the environment variable named by the key. If the variable is present in the environment the value is returned. Otherwise the default is returned.

func LoadEnvVar

func LoadEnvVar(name string, defaultValue string, canBeEmpty bool) string

LoadEnvVar retrieves the value of 'name' frome environment. If canBeEmpty is false and the value of the 'name' is empty, os will exit.

func LoadFloatEnvVar

func LoadFloatEnvVar(name string, defaultValue float64, canBeEmpty bool) float64

func LoadIntEnvVar

func LoadIntEnvVar(name string, defaultValue int, canBeEmpty bool) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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