Documentation ¶
Index ¶
- Variables
- func BinaryName() string
- func DumpClowder(logger zerolog.Logger)
- func DumpConfig(logger zerolog.Logger)
- func Environment() string
- func EnvironmentPrefix(prefix, identifier string) string
- func FeatureEnabled(ctx context.Context, name string) bool
- func HelpText() (string, error)
- func Hostname() string
- func InClowder() bool
- func InEphemeralClowder() bool
- func InProdClowder() bool
- func InStageClowder() bool
- func Initialize(configFiles ...string)
- func InitializeFeatureFlags(ctx context.Context) error
- func LaunchEnabled(ctx context.Context) bool
- func RedisHostAndPort() string
- func StopFeatureFlags(ctx context.Context)
- func StringToURL(urlStr string) *url.URL
- func TopicName(ctx context.Context, topic string) string
- func UnleashContext(ctx context.Context) ucontext.Context
- func WithUnleashContext(ctx context.Context, uctx ucontext.Context) context.Context
Constants ¶
This section is empty.
Variables ¶
var ( Application = &config.App Stats = &config.Stats Reservation = &config.Reservation Database = &config.Database Prometheus = &config.Prometheus Logging = &config.Logging Telemetry = &config.Telemetry Cloudwatch = &config.Cloudwatch AWS = &config.AWS Azure = &config.Azure GCP = &config.GCP RestEndpoints = &config.RestEndpoints ImageBuilder = &config.RestEndpoints.ImageBuilder Sources = &config.RestEndpoints.Sources RBAC = &config.RestEndpoints.RBAC Worker = &config.Worker Unleash = &config.Unleash Sentry = &config.Sentry Kafka = &config.Kafka )
Config shortcuts
var ( ErrValidateMissingSecret = errors.New("config error: Cloudwatch enabled but Region or Key or Secret are blank") ErrValidateGroupStream = errors.New("config error: Cloudwatch enabled but Group or Stream is blank") )
Errors
Functions ¶
func BinaryName ¶
func BinaryName() string
func DumpClowder ¶
DumpClowder writes safely some information from clowder config.
func DumpConfig ¶
DumpConfig writes configuration to a logger. It removes all secrets, however, it is never recommended to call this function in production environments.
func Environment ¶
func Environment() string
Environment returns clowder environment (stage, prod or ephemeral) or "dev" in case the app is not running in Clowder.
func EnvironmentPrefix ¶
EnvironmentPrefix wraps an identifier (e.g. id, unique id) in the following way. For production environment, it returns "prefix-identifier". For any other environment, it returns "prefix-identifier-env". Examples:
* reservation-14572 * reservation-9531-stage * reservation-13-ephemeral * reservation-1-dev
func FeatureEnabled ¶
FeatureEnabled returns a user-specific or global feature flag. When such flag is not found, true is returned.
func InClowder ¶
func InClowder() bool
IsClowder returns true, when the app is running in clowder environment, whether it is production, stage or ephemeral.
func InEphemeralClowder ¶
func InEphemeralClowder() bool
InEphemeralClowder returns true, when the app is running in ephemeral clowder environment.
func InProdClowder ¶
func InProdClowder() bool
InProdClowder returns true, when the app is running in production clowder environment.
func InStageClowder ¶
func InStageClowder() bool
InStageClowder returns true, when the app is running in stage clowder environment.
func Initialize ¶
func Initialize(configFiles ...string)
Initialize loads configuration from provided .env files, the first existing file wins.
func InitializeFeatureFlags ¶
InitializeFeatureFlags configures unleash client and starts poller routine. Callers must close poller by calling StopFeatureFlags function.
func LaunchEnabled ¶
LaunchEnabled: launch button in UI initiates the application workflow
func RedisHostAndPort ¶
func RedisHostAndPort() string
func StopFeatureFlags ¶
StopFeatureFlags stops the unleash feature flag poller
func StringToURL ¶
func TopicName ¶
TopicName returns mapped topic from Clowder. When not running in Clowder mode, it returns the input topic name.
func UnleashContext ¶
UnleashContext returns unleash context or an empty context when not set.
Types ¶
This section is empty.