Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "server", Short: "Server that accepts and assigns jobs to workers", Run: func(cmd *cobra.Command, args []string) { log := viper.Get("logger").(zerolog.Logger) m := server.NewMetricsStore() runtime := server.NewRuntime(m, log, viper.GetInt("peltr.port")) err := runtime.Listen() if err != nil { log.Fatal().Err(err).Msg("Error listening on server port") return } defer runtime.Close() go runtime.HandleConnections() go runtime.ControlLoop() http.HandleFunc("/workers", runtime.HandleListWorkers) http.HandleFunc("/jobs", runtime.HandleListJobQueue) http.HandleFunc("/job", runtime.HandleJob) http.Handle("/metrics", promhttp.Handler()) http.ListenAndServe(fmt.Sprintf(":%d", viper.GetInt("peltr.prom-http")), nil) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.