http

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: ISC Imports: 18 Imported by: 0

Documentation

Index

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

type Option func(*Server) error

Option enables variadic option passing to the server on startup.

func WithFMSConf added in v0.0.12

func WithFMSConf(c fms.Config) Option

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 WithLogger

func WithLogger(l hclog.Logger) Option

WithLogger sets the logger for the server.

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 WithQuads

func WithQuads(q []string) Option

WithQuads tells the server what quadrants are available to configure.

func WithStartupWG

func WithStartupWG(wg *sync.WaitGroup) Option

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

func NewServer

func NewServer(opts ...Option) (*Server, error)

NewServer returns a running field controller.

func (*Server) Serve

func (s *Server) Serve(bind string) error

Serve binds and serves http on the bound socket. An error will be returned if the server cannot initialize.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL