Documentation
¶
Index ¶
- func Version() string
- type LibDragAPI
- func (api *LibDragAPI) CompleteRace(raceID string) error
- func (api *LibDragAPI) GetActiveRaceCount() int
- func (api *LibDragAPI) GetActiveRaceIDs() []string
- func (api *LibDragAPI) GetAllRaceStatuses() map[string]string
- func (api *LibDragAPI) GetMaxConcurrentRaces() int
- func (api *LibDragAPI) GetRaceStatusJSONByID(raceID string) string
- func (api *LibDragAPI) GetResultsJSONByID(raceID string) string
- func (api *LibDragAPI) GetShortRaceID(raceID string) string
- func (api *LibDragAPI) GetTreeStatusJSONByID(raceID string) string
- func (api *LibDragAPI) Initialize() error
- func (api *LibDragAPI) IsRaceCompleteByID(raceID string) bool
- func (api *LibDragAPI) PublishEvent(event events.Event)
- func (api *LibDragAPI) RaceExists(raceID string) bool
- func (api *LibDragAPI) Reset() error
- func (api *LibDragAPI) SetMaxConcurrentRaces(max int)
- func (api *LibDragAPI) SetTestMode(enabled bool)
- func (api *LibDragAPI) StartRaceWithID() (string, error)
- func (api *LibDragAPI) Stop() error
- func (api *LibDragAPI) Subscribe(eventType events.EventType, handler events.EventHandler) func()
- func (api *LibDragAPI) SubscribeAll(handler events.EventHandler) func()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LibDragAPI ¶
type LibDragAPI struct {
// contains filtered or unexported fields
}
LibDragAPI provides a mobile-friendly interface
func NewLibDragAPI ¶
func NewLibDragAPI() *LibDragAPI
func (*LibDragAPI) CompleteRace ¶
func (api *LibDragAPI) CompleteRace(raceID string) error
CompleteRace manually marks a race as complete and cleans up resources
func (*LibDragAPI) GetActiveRaceCount ¶
func (api *LibDragAPI) GetActiveRaceCount() int
GetActiveRaceCount returns the number of currently active races
func (*LibDragAPI) GetActiveRaceIDs ¶
func (api *LibDragAPI) GetActiveRaceIDs() []string
GetActiveRaceIDs returns a list of all currently active race IDs
func (*LibDragAPI) GetAllRaceStatuses ¶
func (api *LibDragAPI) GetAllRaceStatuses() map[string]string
GetAllRaceStatuses returns status information for all active races
func (*LibDragAPI) GetMaxConcurrentRaces ¶
func (api *LibDragAPI) GetMaxConcurrentRaces() int
GetMaxConcurrentRaces returns the maximum number of concurrent races allowed
func (*LibDragAPI) GetRaceStatusJSONByID ¶
func (api *LibDragAPI) GetRaceStatusJSONByID(raceID string) string
GetRaceStatusJSON returns race status as JSON (legacy method) GetRaceStatusJSONByID returns race status as JSON for a specific race
func (*LibDragAPI) GetResultsJSONByID ¶
func (api *LibDragAPI) GetResultsJSONByID(raceID string) string
GetResultsJSON returns race results as JSON (legacy method) GetResultsJSONByID returns race results as JSON for a specific race
func (*LibDragAPI) GetShortRaceID ¶
func (api *LibDragAPI) GetShortRaceID(raceID string) string
GetShortRaceID returns a short identifier for logging purposes
func (*LibDragAPI) GetTreeStatusJSONByID ¶
func (api *LibDragAPI) GetTreeStatusJSONByID(raceID string) string
GetTreeStatusJSONByID returns christmas tree status as JSON for a specific race
func (*LibDragAPI) Initialize ¶
func (api *LibDragAPI) Initialize() error
Initialize the libdrag system
func (*LibDragAPI) IsRaceCompleteByID ¶
func (api *LibDragAPI) IsRaceCompleteByID(raceID string) bool
IsRaceComplete checks if the current race is finished (legacy method) IsRaceCompleteByID checks if a specific race is finished
func (*LibDragAPI) PublishEvent ¶
func (api *LibDragAPI) PublishEvent(event events.Event)
PublishEvent publishes an event to the event bus (for testing or external components)
func (*LibDragAPI) RaceExists ¶
func (api *LibDragAPI) RaceExists(raceID string) bool
RaceExists checks if a race with the given ID exists
func (*LibDragAPI) Reset ¶
func (api *LibDragAPI) Reset() error
Reset clears all active races but keeps the API initialized
func (*LibDragAPI) SetMaxConcurrentRaces ¶
func (api *LibDragAPI) SetMaxConcurrentRaces(max int)
SetMaxConcurrentRaces sets the maximum number of concurrent races allowed
func (*LibDragAPI) SetTestMode ¶
func (api *LibDragAPI) SetTestMode(enabled bool)
SetTestMode enables fast mode for all timing systems (for testing)
func (*LibDragAPI) StartRaceWithID ¶
func (api *LibDragAPI) StartRaceWithID() (string, error)
StartRaceWithID starts a new drag race and returns a unique race ID
func (*LibDragAPI) Stop ¶
func (api *LibDragAPI) Stop() error
Stop shuts down the API and cleans up all active races
func (*LibDragAPI) Subscribe ¶
func (api *LibDragAPI) Subscribe(eventType events.EventType, handler events.EventHandler) func()
Subscribe adds an event handler for a specific event type
func (*LibDragAPI) SubscribeAll ¶
func (api *LibDragAPI) SubscribeAll(handler events.EventHandler) func()
SubscribeAll adds an event handler that receives all events