Documentation
¶
Overview ¶
Package fms encapsulates all the various parts of the Field Managent System, its associated configuration logic, and the APIs that talk to other systems.
Index ¶
- type EventStreamer
- type FMS
- type FileFetcher
- type NetController
- type Option
- func WithEventStreamer(es EventStreamer) Option
- func WithFMSConf(c *config.FMSConfig) Option
- func WithFileFetcher(fetcher FileFetcher) Option
- func WithLogger(l hclog.Logger) Option
- func WithNetController(nc NetController) Option
- func WithStartupWG(wg *sync.WaitGroup) Option
- func WithTeamLocationMapper(t TeamLocationMapper) Option
- type TeamLocationMapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStreamer ¶ added in v0.1.9
type EventStreamer interface {
Handler(nhttp.ResponseWriter, *nhttp.Request)
PublishActionStart(string, string)
PublishActionComplete(string)
PublishError(error)
PublishFileFetch(string)
PublishLogLine(string)
}
EventStreamer represents the streaming interface server that allows websocket subscribers to join the event stream and get broadcast events.
type FMS ¶ added in v0.1.9
type FMS struct {
// contains filtered or unexported fields
}
FMS encapsulates the FMS runnable.
func New ¶ added in v0.1.9
New configures and returns an FMS instance that is a runnable containing the TLM, webserver, and associated other components.
type FileFetcher ¶ added in v0.1.9
FileFetcher fetches restricted files that cannot be baked into the image.
type NetController ¶ added in v0.1.9
type NetController interface {
Zap() error
Init() error
SyncState(map[string]interface{}) error
Converge(bool, string) error
CycleRadio(string) error
BootstrapPhase0() error
BootstrapPhase1() error
BootstrapPhase2() error
BootstrapPhase3() error
}
NetController abstracts the functionality of the RouterOS controller so that the FMS can bootstrap and reconcile the network as required.
type Option ¶ added in v0.1.9
Option enables variadic option passing to the server on startup.
func WithEventStreamer ¶ added in v0.1.9
func WithEventStreamer(es EventStreamer) Option
WithEventStreamer allows injecting a streaming backend for the FMS to serve over http.
func WithFMSConf ¶ added in v0.1.9
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 WithFileFetcher ¶ added in v0.1.9
func WithFileFetcher(fetcher FileFetcher) Option
WithFileFetcher injects the backend that may be used to fetch restrited artifacts from Mikrotik.
func WithLogger ¶ added in v0.1.9
WithLogger sets the logger for the server.
func WithNetController ¶ added in v0.1.9
func WithNetController(nc NetController) Option
WithNetController injects the backend network controller that will actually modify network state.
func WithStartupWG ¶ added in v0.1.9
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 ¶ added in v0.1.9
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 TeamLocationMapper ¶ added in v0.1.9
type TeamLocationMapper interface {
GetFieldForTeam(int) (string, error)
GetActualDS(string) (int, error)
GetCurrentMapping() (map[int]string, error)
InsertOnDemandMap(map[int]string) error
GetStageMapping() (map[int]string, error)
InsertStageMapping(map[int]string) error
CommitStagedMap() 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.