Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRootCommand ¶
func NewRootCommand(name, version string, sets ...FlagSetter) *cobra.Command
NewRootCommand returns a Cobra command with the given name and version. It also adds all the provided pflag.FlagSet items to the command's persistent flags.
func NewRunCmd ¶
func NewRunCmd(c supervisor.Config, f *ConfigFlags, l *LoggerFlags) *cobra.Command
Types ¶
type ConfigFlags ¶ added in v0.22.1
type ConfigFlags struct {
// contains filtered or unexported fields
}
ConfigFlags is used to load multiple config files.
func ConfigFlagsForConfig ¶ added in v0.22.1
func ConfigFlagsForConfig(d config.HasDefaults) ConfigFlags
func ConfigFlagsWithEmbeds ¶ added in v0.22.1
func ConfigFlagsWithEmbeds(embeds ...[]byte) ConfigFlags
func (*ConfigFlags) FlagSet ¶ added in v0.22.1
func (ff *ConfigFlags) FlagSet() *pflag.FlagSet
FlagSet binds CLI args [--config or -c] for config files as a pflag.FlagSet.
func (*ConfigFlags) Load ¶ added in v0.22.1
func (ff *ConfigFlags) Load(c any) error
Load loads the config files into the given config struct.
type FlagSetter ¶ added in v0.11.4
type LoggerFlags ¶
type LoggerFlags struct {
// contains filtered or unexported fields
}
LoggerFlags is a set of flags for configuring a logger. It glues together the pflag.Value interface with the log.Logger interface.
func (*LoggerFlags) FlagSet ¶ added in v0.11.4
func (lf *LoggerFlags) FlagSet() *pflag.FlagSet
FlagSet binds CLI args [ --log.verbosity | -v ] and [ --log.format | -f ] for config files as a pflag.FlagSet.
func (*LoggerFlags) Logger ¶
func (lf *LoggerFlags) Logger() log.Logger
Click to show internal directories.
Click to hide internal directories.