Documentation ¶
Index ¶
- func GenModulesCmd(name, version string, modulesFactory modulesManagerFactory) *cobra.Command
- type BeatsRootCmd
- func GenRootCmd(name, version string, beatCreator beat.Creator) *BeatsRootCmd
- func GenRootCmdWithIndexPrefixWithRunFlags(name, indexPrefix, version string, beatCreator beat.Creator, ...) *BeatsRootCmd
- func GenRootCmdWithRunFlags(name, version string, beatCreator beat.Creator, runFlags *pflag.FlagSet) *BeatsRootCmd
- type ModulesManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenModulesCmd ¶
GenModulesCmd initializes a command to manage a modules.d folder, it offers list, enable and siable actions
Types ¶
type BeatsRootCmd ¶
type BeatsRootCmd struct { cobra.Command RunCmd *cobra.Command SetupCmd *cobra.Command VersionCmd *cobra.Command CompletionCmd *cobra.Command ExportCmd *cobra.Command TestCmd *cobra.Command }
BeatsRootCmd handles all application command line interface, parses user flags and runs subcommands
func GenRootCmd ¶
func GenRootCmd(name, version string, beatCreator beat.Creator) *BeatsRootCmd
GenRootCmd returns the root command to use for your beat. It takes beat name as parameter, and also run command, which will be called if no args are given (for backwards compatibility)
func GenRootCmdWithIndexPrefixWithRunFlags ¶ added in v6.1.0
func GenRootCmdWithRunFlags ¶
func GenRootCmdWithRunFlags(name, version string, beatCreator beat.Creator, runFlags *pflag.FlagSet) *BeatsRootCmd
GenRootCmdWithRunFlags returns the root command to use for your beat. It takes beat name as parameter, and also run command, which will be called if no args are given (for backwards compatibility). runFlags parameter must the flagset used by run command
type ModulesManager ¶
type ModulesManager interface { ListEnabled() []*cfgfile.CfgFile ListDisabled() []*cfgfile.CfgFile Exists(name string) bool Enabled(name string) bool Enable(name string) error Disable(name string) error }
ModulesManager interface provides all actions needed to implement modules command (to list, enable & disable modules)