simple

package
v0.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(t *TLM)

Option configures the TLM

func WithLogger

func WithLogger(l hclog.Logger) Option

WithLogger configures the logger for the team location mapper

func WithMetrics

func WithMetrics(m *metrics.Metrics) Option

WithMetrics pushes a metrics instance to the TLM subsystem so that metrics can know what match is up.

func WithStartupWG

func WithStartupWG(w *sync.WaitGroup) Option

WithStartupWG allows a waitgroup to be passed in so the server can notify when its finished startup tasks with a nice message on the console.

type TLM

type TLM struct {
	// contains filtered or unexported fields
}

TLM is a Team Location Mapper that contains a static mapping.

func New

func New(opts ...Option) *TLM

New configures the TLM with the given options.

func (*TLM) GetCurrentMapping

func (tlm *TLM) GetCurrentMapping() (map[int]string, error)

GetCurrentMapping is a convenience function to retrieve the current mapping for the current match.

func (*TLM) GetCurrentTeams

func (tlm *TLM) GetCurrentTeams() []int

GetCurrentTeams returns the teams that are expected to be on the field at this time.

func (*TLM) GetFieldForTeam

func (tlm *TLM) GetFieldForTeam(team int) (string, error)

GetFieldForTeam returns the current location for a given team number.

func (*TLM) InsertOnDemandMap

func (tlm *TLM) InsertOnDemandMap(m map[int]string) error

InsertOnDemandMap inserts an on-demand mapping that overrides any current schedule. WARNING: This is immediate.

func (*TLM) Start

func (tlm *TLM) Start() error

Start starts up a pusher that publishes location information into the broker.

func (*TLM) Stop

func (tlm *TLM) Stop()

Stop cancels the async location pusher.

Jump to

Keyboard shortcuts

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