Documentation
¶
Index ¶
- type MQTTServer
- type Option
- func WithFMSConf(c fms.Config) Option
- func WithLogger(l hclog.Logger) Option
- func WithMQTTServer(mq MQTTServer) Option
- func WithPrometheusRegistry(reg *prometheus.Registry) Option
- func WithQuads(q []string) Option
- func WithStartupWG(wg *sync.WaitGroup) Option
- func WithTeamLocationMapper(t TeamLocationMapper) Option
- type Server
- type TeamLocationMapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MQTTServer ¶ added in v0.0.12
type MQTTServer interface { Clients() map[string]mqttserver.ClientInfo GizmoMeta(int) (bool, config.GizmoMeta) DSMeta(int) (bool, config.DSMeta) }
MQTTServer contains the specific limited interface that needs to be made available for the HUD
type Option ¶
Option enables variadic option passing to the server on startup.
func WithFMSConf ¶ added in v0.0.12
WithFMSConf generates all the quad data out of the config for the FMS itself. It provides a more convenient system than using the direct Quad interface.
func WithMQTTServer ¶ added in v0.0.12
func WithMQTTServer(mq MQTTServer) Option
WithMQTTServer provides the specific MQTTServer that's fronted by this webserver.
func WithPrometheusRegistry ¶
func WithPrometheusRegistry(reg *prometheus.Registry) Option
WithPrometheusRegistry sets the Prometheus registry for the server
func WithStartupWG ¶
WithStartupWG allows a waitgroup to be passed in so the server can notify when its finished with startup tasks to allow a nice message to be printed to the console.
func WithTeamLocationMapper ¶
func WithTeamLocationMapper(t TeamLocationMapper) Option
WithTeamLocationMapper sets the mapper instance for the server to get from team number and schedule step to the field that they're supposed to be on.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server manages the HTTP serving components
type TeamLocationMapper ¶
type TeamLocationMapper interface { GetFieldForTeam(int) (string, error) GetCurrentMapping() (map[int]string, error) InsertOnDemandMap(map[int]string) error }
TeamLocationMapper looks at all teams trying to fetch a value and tries to get them controller based on their current match and their number.