config

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmbeddedMode      = "embedded"
	MasterMode        = "master"
	MasterSlaveMode   = "master_and_slave"
	SlaveMode         = "slave"
	OffMode           = "off"
	PooledWHSlaveMode = "embedded_master"
)

Rudder server supported config constants

Variables

This section is empty.

Functions

func GetArraySupportForCH added in v0.1.10

func GetArraySupportForCH() bool

func GetBool

func GetBool(key string, defaultValue bool) (value bool)

GetBool is a wrapper for viper's GetBool

func GetDuration

func GetDuration(key string, defaultValueInTimescaleUnits int64, timeScale time.Duration) (value time.Duration)

GetDuration is wrapper for viper's GetDuration

func GetEnv

func GetEnv(key string, defaultVal string) string

GetEnv returns the environment value stored in key variable

func GetEnvAsBool

func GetEnvAsBool(name string, defaultVal bool) bool

GetEnvAsBool returns the boolean environment value stored in key variable

func GetEnvAsInt added in v0.1.10

func GetEnvAsInt(key string, defaultVal int) int

GetEnvAsInt returns the int value of environment value stored in the key variable If not set, default value will be return. If set but unparsable, returns 0

func GetFloat64

func GetFloat64(key string, defaultValue float64) (value float64)

GetFloat64 is wrapper for viper's GetFloat64

func GetInstanceID added in v0.1.10

func GetInstanceID() string

func GetInt

func GetInt(key string, defaultValue int) (value int)

GetInt is wrapper for viper's GetInt

func GetInt64

func GetInt64(key string, defaultValue int64) (value int64)

GetInt64 is wrapper for viper's GetInt

func GetKubeNamespace added in v0.1.10

func GetKubeNamespace() string

GetKubeNamespace returns value stored in KUBE_NAMESPACE env var

func GetNamespaceIdentifier added in v0.1.10

func GetNamespaceIdentifier() string

func GetReleaseName added in v0.1.10

func GetReleaseName() string

func GetRequiredEnv

func GetRequiredEnv(key string) string

GetRequiredEnv returns the environment value stored in key variable, no default

func GetRequiredEnvAsInt added in v0.1.10

func GetRequiredEnvAsInt(key string) int

GetRequiredEnvAsInt returns the environment value stored in key variable as int, no default

func GetString

func GetString(key string, defaultValue string) (value string)

GetString is wrapper for viper's GetString

func GetStringSlice added in v0.1.10

func GetStringSlice(key string, defaultValue []string) (value []string)

GetStringSlice is wrapper for viper's GetStringSlice

func GetVarCharMaxForRS added in v0.1.10

func GetVarCharMaxForRS() bool

func GetWHSchemaVersion added in v0.1.10

func GetWHSchemaVersion() string

func GetWorkspaceToken

func GetWorkspaceToken() string

GetWorkspaceToken returns the workspace token provided in the environment variables Env variable CONFIG_BACKEND_TOKEN is deprecating soon WORKSPACE_TOKEN is newly introduced. This will override CONFIG_BACKEND_TOKEN

func IsEnvSet added in v0.1.10

func IsEnvSet(key string) bool

IsEnvSet checks if an environment variable is set

func IsSet added in v0.1.10

func IsSet(key string) bool

IsSet checks if config is set for a key

func IsTransformedEnvSet added in v0.1.10

func IsTransformedEnvSet(key string) bool

func Load added in v0.1.10

func Load()

func MustGetEnv added in v0.1.10

func MustGetEnv(key string) string

func RegisterBoolConfigVariable added in v0.1.10

func RegisterBoolConfigVariable(defaultValue bool, ptr *bool, isHotReloadable bool, keys ...string)

func RegisterDurationConfigVariable added in v0.1.10

func RegisterDurationConfigVariable(defaultValueInTimescaleUnits int64, ptr *time.Duration, isHotReloadable bool, timeScale time.Duration, keys ...string)

func RegisterFloat64ConfigVariable added in v0.1.10

func RegisterFloat64ConfigVariable(defaultValue float64, ptr *float64, isHotReloadable bool, keys ...string)

func RegisterInt64ConfigVariable added in v0.1.10

func RegisterInt64ConfigVariable(defaultValue int64, ptr *int64, isHotReloadable bool, valueScale int64, keys ...string)

func RegisterIntConfigVariable added in v0.1.10

func RegisterIntConfigVariable(defaultValue int, ptr *int, isHotReloadable bool, valueScale int, keys ...string)

func RegisterStringConfigVariable added in v0.1.10

func RegisterStringConfigVariable(defaultValue string, ptr *string, isHotReloadable bool, keys ...string)

func RegisterStringSliceConfigVariable added in v0.1.10

func RegisterStringSliceConfigVariable(defaultValue []string, ptr *[]string, isHotReloadable bool, keys ...string)

func SetBool

func SetBool(key string, value bool)

SetBool override existing config

func SetString

func SetString(key string, value string)

func SetWHSchemaVersion added in v0.1.10

func SetWHSchemaVersion(version string)

func TransformKey added in v0.1.10

func TransformKey(s string) string

TransformKey as package method to get the formatted env from a give string

func UpdateConfig added in v0.1.10

func UpdateConfig()

Types

type ConfigVar added in v0.1.10

type ConfigVar struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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