fms

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: ISC Imports: 19 Imported by: 0

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

View Source
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 LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig reads config off disk.

func WizardChangeChannels added in v0.1.4

func WizardChangeChannels(c *Config) (*Config, error)

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

func WizardChangeIntegrations(c *Config) (*Config, error)

WizardChangeIntegrations can be used to reconfigure what integrations are enabled.

func WizardChangeRadioMode added in v0.1.6

func WizardChangeRadioMode(c *Config) (*Config, error)

WizardChangeRadioMode is used to reconfigure the radio mode after it has been initially setup.

func WizardChangeRoster added in v0.1.0

func WizardChangeRoster(c *Config) (*Config, error)

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

func WizardSurvey(wouldOverwrite bool) (*Config, error)

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 Field

type Field struct {
	ID  int
	IP  string
	MAC string

	Channel string
}

Field contains the information related to each field.

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

func (st *SetupTool) Configure() error

Configure calls all the configure steps to configure the FMS workstation.

func (*SetupTool) Install added in v0.1.0

func (st *SetupTool) Install() error

Install pulls in all the packages and things that we need the network for and is intended to be called during a CI build to retrieve everything that's required to construct the image. Install does not require the system services to be running.

func (*SetupTool) SetupBoot added in v0.1.0

func (st *SetupTool) SetupBoot() error

SetupBoot installs the runtime hooks that startup the configuration jobs.

type Team

type Team struct {
	Name     string
	SSID     string
	PSK      string
	VLAN     int
	CIDR     string
	GizmoMAC string
	DSMAC    string
}

Team maintains information about a team from the perspective of the FMS

Jump to

Keyboard shortcuts

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