Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PurgeCmd = &cobra.Command{ Use: "purge", Short: "A brief description of your command", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, SilenceUsage: true, SilenceErrors: true, PreRunE: func(cmd *cobra.Command, args []string) error { if len(args) > 0 { return utils.ErrTooManyArgs } return nil }, RunE: func(cmd *cobra.Command, args []string) error { logger := cmd.Context().Value(constants.LoggerKey{}).(zerolog.Logger) socketPath := cmd.Context().Value(constants.SocketPathKey{}).(string) logger.Info(). Str("operation", cmd.Name()). Msg(constants.ProcessCommand) res, err := utils.SendCommandToDaemon(socketPath, cmd.Name()) if err != nil { logger.Error().Str("command", cmd.Name()).Err(err).Msg(constants.FailedToProcessCommand) return &utils.CommandError{Err: err, Code: 12} } logger.Info(). Str("command", cmd.Name()). Str("response", res). Msg(constants.SuccessfullyProcessed) return nil }, }
PurgeCmd represents the purge command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.