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 ¶
- Constants
- type Config
- func LoadConfig(path string) (*Config, error)
- func WizardChangeChannels(c *Config) (*Config, error)
- func WizardChangeIntegrations(c *Config) (*Config, error)
- func WizardChangeRadioMode(c *Config) (*Config, error)
- func WizardChangeRoster(c *Config) (*Config, error)
- func WizardSurvey(wouldOverwrite bool) (*Config, error)
- type ConfigureStep
- type Field
- type Integration
- type IntegrationSlice
- type SetupTool
- type Team
Constants ¶
const ( // AutomationUser is created on remote systems to allow the // FMS to manage them programattically. AutomationUser = "gizmo-fms" // ViewOnlyUser is created on remote systems to enable // debugging and generally make it possible to get into // systems. ViewOnlyUser = "gizmo-ro" // IntegrationPCSM provides API endpoints for the BEST // Robotics PCSM to control the match mapping. IntegrationPCSM Integration = iota )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Teams contains the information needed to generate // configuration for all teams. Teams map[int]*Team // Fields contains a list of fields that are configured and // managed by the system. Fields map[int]*Field // FMSMac is the mac address of the FMS itself so that it can // have a pinned address FMSMac string // RadioMode is used to determine which radios are active for // the field. This can be 'NONE', 'FIELD', or 'DS'. 'NONE' // predicably disables all radios and is really only useful in // games where there is a field tether. 'FIELD' operates // using the high-power field radio and causes driver's // station radios to be disabled, whereas 'DS' is the inverse // causing the field radio to be disabled and remotely // controlling the DS radios. RadioMode string AutoUser string AutoPass string ViewUser string ViewPass string // This is the actual "admin" user in RouterOS. Generally // nobody should be logged in as this, but its here anyway so // its a known value. AdminPass string Integrations IntegrationSlice InfrastructureVisible bool InfrastructureSSID string InfrastructurePSK string // There are cases where fixed DNS servers are desirable. FixedDNS []string AdvancedBGPAS int AdvancedBGPIP string AdvancedBGPPeerIP string AdvancedBGPVLAN int }
Config contains all the data that's necessary to setup the FMS and manage the network behind it.
func WizardChangeChannels ¶ added in v0.1.4
WizardChangeChannels is used to reconfigure the channels each field is assigned to. This function duplicates some of the config in the field configuration step, but this is to avoid any possibility of creating or destroying a field.
func WizardChangeIntegrations ¶ added in v0.1.8
WizardChangeIntegrations can be used to reconfigure what integrations are enabled.
func WizardChangeRadioMode ¶ added in v0.1.6
WizardChangeRadioMode is used to reconfigure the radio mode after it has been initially setup.
func WizardChangeRoster ¶ added in v0.1.0
WizardChangeRoster is used to change the roster in an FMS Config that already exists. Teams will be loaded then reconciled. Existing teams can have name updated, but wireless parameters will not be changed.
func WizardSurvey ¶
WizardSurvey runs a step by step config workflow to gather all the information required to generate the software configuration for the FMS.
type ConfigureStep ¶ added in v0.1.0
type ConfigureStep func() error
A ConfigureStep performa various changes to the system to configure it.
type Integration ¶ added in v0.1.8
type Integration int
Integration is an enum type for things that can talk to the Gizmo FMS that may need to be switched on or off.
type IntegrationSlice ¶ added in v0.1.8
type IntegrationSlice []Integration
IntegrationSlice is used to shadow []int to construct some methods that work on the various integrations.
func IntegrationsFromStrings ¶ added in v0.1.8
func IntegrationsFromStrings(s []string) IntegrationSlice
IntegrationsFromStrings parses a list of strings and returns the corresponding integrations.
func (IntegrationSlice) Enabled ¶ added in v0.1.8
func (is IntegrationSlice) Enabled(t Integration) bool
Enabled tests to see if a given integration is enabled or not.
func (IntegrationSlice) ToStrings ¶ added in v0.1.8
func (is IntegrationSlice) ToStrings() []string
ToStrings converts integrations into a slice of strings.
type SetupTool ¶ added in v0.1.0
type SetupTool struct {
// contains filtered or unexported fields
}
SetupTool does a lot of setup things for the FMS that are not something normal users would need to run.
func NewSetupTool ¶ added in v0.1.0
func NewSetupTool(l hclog.Logger) *SetupTool
NewSetupTool sets up a logger for the setup tool.
func (*SetupTool) Configure ¶ added in v0.1.0
Configure calls all the configure steps to configure the FMS workstation.