consumer.go 666 B

12345678910111213141516171819202122232425262728293031323334
  1. package cmd
  2. import (
  3. "kpt-pasture/dep"
  4. "gitee.com/xuyiping_admin/pkg/logger/zaplog"
  5. "go.uber.org/zap"
  6. "github.com/spf13/cobra"
  7. )
  8. // ConsumerCmd represents the consumer command
  9. var ConsumerCmd = &cobra.Command{
  10. Use: "consumer",
  11. Short: "start consumer",
  12. PersistentPreRun: func(cmd *cobra.Command, args []string) {
  13. },
  14. }
  15. func init() {
  16. ConsumerCmd.AddCommand(workOrder)
  17. }
  18. var workOrder = &cobra.Command{
  19. Use: "workOrder",
  20. Short: "kpt pasture work order",
  21. Run: func(cmd *cobra.Command, args []string) {
  22. srv := dep.DIAsynqWorkOrder()
  23. if err := srv.Server.Run(srv.Mux); err != nil {
  24. zaplog.Error("eventWorkflow", zap.Any("err", err))
  25. }
  26. },
  27. }