Documentation
¶
Overview ¶
Package config contains a convenient structure to pass around configuration data.
Index ¶
- Constants
- func LoadTeams(fr io.Reader) (map[int]*Team, error)
- type DSMeta
- type FMSConfig
- func (c *FMSConfig) Load() error
- func (c *FMSConfig) ReconcileTeams(t map[int]*Team)
- func (c *FMSConfig) Save() error
- func (c *FMSConfig) SortedTeams() []*Team
- func (c *FMSConfig) WizardChangeChannels() error
- func (c *FMSConfig) WizardChangeIntegrations() error
- func (c *FMSConfig) WizardChangeRadioMode() error
- func (c *FMSConfig) WizardChangeRoster() error
- func (c *FMSConfig) WizardSurvey(wouldOverwrite bool) error
- type Field
- type GSSConfig
- type GSSServer
- type GizmoMeta
- type Integration
- type IntegrationSlice
- type Option
- type Provider
- 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" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DSMeta ¶ added in v0.1.4
DSMeta stores information reported by the Driver's Station metadata feed.
func (DSMeta) BootmodeOK ¶ added in v0.1.9
BootmodeOK compares if the boot mode is in the list of accepted bootmodes.
type FMSConfig ¶ added in v0.1.9
type FMSConfig 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
// CompatData is used so the HUD can flag team hardware that
// is out of compliance.
CompatHardwareVersions string
CompatFirmwareVersions string
CompatDSBootmodes string
CompatDSVersions string
// contains filtered or unexported fields
}
FMSConfig contains all the data that's necessary to setup the FMS and manage the network behind it.
func NewFMSConfig ¶ added in v0.1.9
NewFMSConfig returns a new configuration instance, that has been loaded from the default path if possible.
func (*FMSConfig) ReconcileTeams ¶ added in v0.1.9
ReconcileTeams updates the configuration's team list to match the one that is provided. This has to be done with care to avoid cycling security keys unnecessarily.
func (*FMSConfig) Save ¶ added in v0.1.9
Save persists a config to the named path, creating it if necessary.
func (*FMSConfig) SortedTeams ¶ added in v0.1.9
SortedTeams returns a list of teams that are sorted by the team number. This makes it easy to visually scan a team list and know roughly where they should be.
func (*FMSConfig) WizardChangeChannels ¶ added in v0.1.9
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 (*FMSConfig) WizardChangeIntegrations ¶ added in v0.1.9
WizardChangeIntegrations can be used to reconfigure what integrations are enabled.
func (*FMSConfig) WizardChangeRadioMode ¶ added in v0.1.9
WizardChangeRadioMode is used to reconfigure the radio mode after it has been initially setup.
func (*FMSConfig) WizardChangeRoster ¶ added in v0.1.9
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 (*FMSConfig) WizardSurvey ¶ added in v0.1.9
WizardSurvey runs a step by step config workflow to gather all the information required to generate the software configuration for the FMS.
type GSSConfig ¶ added in v0.1.9
GSSConfig holds a number of settings that are unique to each driver station and gizmo pair.
type GSSServer ¶ added in v0.1.9
type GSSServer struct {
// contains filtered or unexported fields
}
GSSServer is a binding of the related functions that make up the configuration interface for the Gizmo itself.
func NewGSSServer ¶ added in v0.1.9
NewGSSServer returns the server instance with the options set
type GizmoMeta ¶ added in v0.1.4
GizmoMeta stores information reported by the Gizmo metadata feed.
func (GizmoMeta) FWVersionOK ¶ added in v0.1.9
FWVersionOK checks if the firmware version is in the list of known firmware versions.
func (GizmoMeta) HWVersionOK ¶ added in v0.1.9
HWVersionOK checks if the hardware version is in the list of known hardware versions.
type Integration ¶ added in v0.1.9
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.
const ( // IntegrationPCSM provides API endpoints for the BEST // Robotics PCSM to control the match mapping. IntegrationPCSM Integration = iota )
type IntegrationSlice ¶ added in v0.1.9
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.9
func IntegrationsFromStrings(s []string) IntegrationSlice
IntegrationsFromStrings parses a list of strings and returns the corresponding integrations.
func (IntegrationSlice) Enabled ¶ added in v0.1.9
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.9
func (is IntegrationSlice) ToStrings() []string
ToStrings converts integrations into a slice of strings.
type Option ¶
type Option func(*GSSServer)
Option configures the server
func WithLogger ¶
WithLogger sets the logging instance for this config server.
func WithOneshotMode ¶ added in v0.1.4
func WithOneshotMode() Option
WithOneshotMode instructs the configserver to exit after a single provisioning cycle.
func WithProvider ¶
WithProvider sets up the config provider that will be used by this server.