Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AgentCmd = &cobra.Command{ Use: "agent", Short: "start agent", Run: func(cmd *cobra.Command, args []string) { logging.Info("start agent\n") var options Options err := utils.Load(configFile, &options) if err != nil { logging.WithError(err).Warnf("failed to load config file %s, use default", configFile) } ctx := context.Background() stopCh := make(chan os.Signal, 1) signal.Notify(stopCh, syscall.SIGTERM, syscall.SIGINT) apiController := api.NewRestfulController(options.Agent) if apiController == nil { logging.Error("cannot create API controller") return } apiController.Start(ctx) select { case s := <-stopCh: logging.Warningf("received signal %v, shutting down ...", s) } apiController.Stop(ctx) }, }
AgentCmd agent command
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Agent model.RestServiceOptions `json:"agent" yaml:"agent"`
}
Options Options
Click to show internal directories.
Click to hide internal directories.