config

package
v0.146.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindConfigToFlags added in v0.145.0

func BindConfigToFlags(v *viper.Viper, cmd *cobra.Command, config any) error

func CommonFlags added in v0.144.0

func CommonFlags() *pflag.FlagSet

func LoadConfigFromContext

func LoadConfigFromContext(ctx context.Context) any

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"`
	IsLocal                 bool   `mapstructure:"is-local"`

	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"`
	Metrics         struct {
		BindAddress string `mapstructure:"metrics-bind-address"`
		Secure      bool   `mapstructure:"metrics-secure"`
	} `mapstructure:",squash"`
	EnableHTTP2            bool   `mapstructure:"enable-http2"`
	HealthProbeBindAddress string `mapstructure:"health-probe-bind-address"`

	LeaderElection struct {
		Enabled bool `mapstructure:"leader-elect"`
	} `mapstructure:",squash"`

	Sentry struct {
		Dsn string `mapstructure:"sentry-dsn"`
	} `mapstructure:",squash"`
}

func NewDefaultConfig added in v0.145.0

func NewDefaultConfig(rootCmd *cobra.Command) (*viper.Viper, *CommonServiceConfig, error)

Jump to

Keyboard shortcuts

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