Documentation
¶
Overview ¶
Package configs implements the configuration for the host.
Index ¶
- Variables
- func AddCobraFlags(v *viper.Viper, cmd *cobra.Command, funcs ...func(*flag.FlagSet) error) error
- func AddCobraPersistentFlags(v *viper.Viper, cmd *cobra.Command, funcs ...func(*flag.FlagSet) error) error
- func AddFlag[T any](v *viper.Viper, name string, value T, usage string) error
- func AddFlagsForCommon(flagSet *flag.FlagSet) error
- func FlagName(flags ...string) string
- func InitFromViperForCommon(v *viper.Viper) (bool, string, error)
- func NewLogger(debug bool, logLevel string) (*zap.Logger, error)
- func NewViper() (*viper.Viper, error)
- func NewViperFromConfig(onCreation func(*viper.Viper) error) (*viper.Viper, error)
- func Viperize(funcs ...func(*flag.FlagSet) error) (*viper.Viper, *cobra.Command, error)
- type Configurable
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigInvalidLogLevel = errors.New("config: invalid log level")
Functions ¶
func AddCobraFlags ¶
AddCobraFlags adds flags to the viper and the cobra command.
func AddCobraPersistentFlags ¶
func AddFlagsForCommon ¶
AddFlagsForCommon adds the common flags to the flag set.
func InitFromViperForCommon ¶
InitFromViperForCommon initializes the common configuration from the viper.
func NewViperFromConfig ¶
NewViperFromConfig creates a new viper from the config.
Types ¶
Click to show internal directories.
Click to hide internal directories.