Documentation ¶
Index ¶
- Variables
- func NewFilesFlagSet(cfp *FilesFlags) *pflag.FlagSet
- func NewLoggerFlagSet(logger *LoggerFlags) *pflag.FlagSet
- func NewRootCommand(name, version string, sets ...*pflag.FlagSet) *cobra.Command
- func NewRunCmd(c supervisor.Config, f *FilesFlags, l *LoggerFlags) *cobra.Command
- type FilesFlags
- type LoggerFlags
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "unknown"
Version that can be used by commands. It is supposed to by set by the linker during build.
Functions ¶
func NewFilesFlagSet ¶
func NewFilesFlagSet(cfp *FilesFlags) *pflag.FlagSet
NewFilesFlagSet binds CLI args [--config or -c] for config files as a pflag.FlagSet.
func NewLoggerFlagSet ¶
func NewLoggerFlagSet(logger *LoggerFlags) *pflag.FlagSet
func NewRootCommand ¶
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 *FilesFlags, l *LoggerFlags) *cobra.Command
Types ¶
type FilesFlags ¶
type FilesFlags struct {
// contains filtered or unexported fields
}
FilesFlags is used to load multiple config files.
func (FilesFlags) Load ¶
func (cf FilesFlags) Load(c any) error
Load loads the config files into the given config struct.
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) Logger ¶
func (logger *LoggerFlags) Logger() log.Logger
Click to show internal directories.
Click to hide internal directories.