Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenModulesCmd ¶
func GenModulesCmd(name, version string, modulesFactory ModulesManagerFactory) *cobra.Command
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 paramter, and also run command, which will be called if no args are given (for backwards compatibility)
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 paramter, 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)
type ModulesManagerFactory ¶
type ModulesManagerFactory func(beat *beat.Beat) (ModulesManager, error)
ModulesManagerFactory builds and return a ModulesManager for the given Beat