config

package
v0.0.0-...-0ade494 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 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

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, 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

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 GetEnvErr

func GetEnvErr(key string) (string, error)

GetEnvErr returns the value of environment variable, error if not exists

func GetFloat64

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

GetFloat64 is wrapper for viper's GetFloat64

func GetInstanceID

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

func GetKubeNamespace() string

GetKubeNamespace returns value stored in KUBE_NAMESPACE env var

func GetNamespaceIdentifier

func GetNamespaceIdentifier() string

func GetReleaseName

func GetReleaseName() string

func GetRequiredEnv

func GetRequiredEnv(key string) string

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

func GetRequiredEnvAsInt

func GetRequiredEnvAsInt(key string) int

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

func GetString

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

GetString is wrapper for viper's GetString

func GetStringSlice

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

GetStringSlice is wrapper for viper's GetStringSlice

func GetVarCharMaxForRS

func GetVarCharMaxForRS() bool

func GetWHSchemaVersion

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

func IsEnvSet(key string) bool

IsEnvSet checks if an environment variable is set

func IsSet

func IsSet(key string) bool

IsSet checks if config is set for a key

func IsTransformedEnvSet

func IsTransformedEnvSet(key string) bool

func Load

func Load()

func MustGetEnv

func MustGetEnv(key string) string

func RegisterBoolConfigVariable

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

func RegisterDurationConfigVariable

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

func RegisterFloat64ConfigVariable

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

func RegisterInt64ConfigVariable

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

func RegisterIntConfigVariable

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

func RegisterStringConfigVariable

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

func RegisterStringSliceConfigVariable

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

func SetBool

func SetBool(key string, value bool)

SetBool override existing config

func SetHotReloadablesForcefully

func SetHotReloadablesForcefully(key string, value interface{})

func SetString

func SetString(key, value string)

func SetWHSchemaVersion

func SetWHSchemaVersion(version string)

func TransformKey

func TransformKey(s string) string

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

func UpdateConfig

func UpdateConfig()

Types

type ConfigVar

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

Directories

Path Synopsis
Package backendconfig is a generated GoMock package.
Package backendconfig is a generated GoMock package.

Jump to

Keyboard shortcuts

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