config

package
v1.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFlagsToViper

func BindFlagsToViper(cmd *cobra.Command, viper *viper.Viper)

Bind each cobra flag to its associated viper configuration (config file and environment variable) This approach cribbed from https://github.com/carolynvs/stingoftheviper/blob/19bd73117f0285436505ca17616cbc394d22e63d/main.go

func Configure

func Configure(cmd *cobra.Command) error

func InitColor

func InitColor(rootCmd *cobra.Command)

func SetupViper

func SetupViper(cfgFile string) (*viper.Viper, error)

Types

type BundleConfig

type BundleConfig struct {
	BundlesFolder string `mapstructure:"bundles_folder"`
}

type ClientConfig

type ClientConfig struct {
	RetryCount    int           `mapstructure:"EDGE.API_RETRIES"`
	StartWaitTime time.Duration `mapstructure:"EDGE.API_RETRY_WAIT_MIN"`
	MaxWaitTime   time.Duration `mapstructure:"EDGE.API_RETRY_WAIT_MAX"`
}

type WorkerConfig

type WorkerConfig struct {
	ClientConfig    ClientConfig `mapstructure:",squash"`
	ApiJWTSecretKey string       `mapstructure:"API_AUTH.SECRET_KEY"`
	Issuer          string       `mapstructure:"API_AUTH.ISSUER"`
	Queues          []string     `mapstructure:"QUEUES"`
	Hostname        string       `mapstructure:"EDGE.HOSTNAME"`
	ApiURL          string       `mapstructure:"EDGE.API_URL"`
}

Jump to

Keyboard shortcuts

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