config

package
v0.144.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonFlags added in v0.144.0

func CommonFlags() *pflag.FlagSet

func LoadConfigFromContext

func LoadConfigFromContext(ctx context.Context) any

func NewConfigFor added in v0.144.0

func NewConfigFor(serviceConfig any) (*viper.Viper, error)

func SetConfigInContext

func SetConfigInContext(ctx context.Context, config any) context.Context

Types

type CommonServiceConfig added in v0.144.0

type CommonServiceConfig struct {
	DebugLabelValue         string `mapstructure:"debug-label-value"`
	MaxConcurrentReconciles int    `mapstructure:"max-concurrent-reconciles"`
	Environment             string `mapstructure:"environment"`
	Region                  string `mapstructure:"region"`
	Kubeconfig              string `mapstructure:"kubeconfig"`
	Image                   struct {
		Name string `mapstructure:"image-name"`
		Tag  string `mapstructure:"image-tag"`
	} `mapstructure:",squash"`
	Log struct {
		Level string `mapstructure:"log-level"`

		NoJson bool `mapstructure:"no-json"`
	} `mapstructure:",squash"`
	ShutdownTimeout time.Duration `mapstructure:"shutdown-timeout"`
	Probes          struct {
		BindAddress string `mapstructure:"probes-bind-address"`
	} `mapstructure:",squash"`
	LeaderElection struct {
		Enabled bool `mapstructure:"leader-election-enabled"`
	} `mapstructure:",squash"`
	Sentry struct {
		Dsn string `mapstructure:"sentry-dsn"`
	} `mapstructure:",squash"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳