ftc

package
v0.0.0-...-f3748ee Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: BSD-3-Clause Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLeagueMembers

func GetLeagueMembers(season, regionCode, leagueCode string) ([]int, error)

GetLeagueMembers returns the list of members in the league

Types

type Advancement

type Advancement struct {
	Team        int    `json:"team"`
	DisplayTeam string `json:"displayTeam"`
	Slot        int    `json:"slot"`
	Criteria    string `json:"criteria"`
	Status      string `json:"status"`
}

Advancement is the advancement information for a given team

func (Advancement) String

func (a Advancement) String() string

type AdvancementsFrom

type AdvancementsFrom struct {
	AdvancedFrom       string         `json:"advancedFrom"`
	AdvancedFromRegion *string        `json:"advancedFromRegion"`
	Slots              int            `json:"slots"`
	Advancement        []*Advancement `json:"advancement"`
}

AdvancementsFrom is the list of teams advancing to a future tournament

func GetAdvancementsFrom

func GetAdvancementsFrom(season, eventCode string) ([]*AdvancementsFrom, error)

GetAdvancementFrom returns the source events from which teams advanced from to reach the specified event.

func (AdvancementsFrom) String

func (a AdvancementsFrom) String() string

type AdvancementsTo

type AdvancementsTo struct {
	AdvancesTo  string         `json:"advancesTo"`
	Slots       int            `json:"slots"`
	Advancement []*Advancement `json:"advancement"`
}

AdvancementsTo is the list of teams that advanced from or to a given tournament

func GetAdvancementsTo

func GetAdvancementsTo(season, eventCode string, excludeSkipped ...bool) (*AdvancementsTo, error)

GetAdvancementTo returns the list of teams advancing from the event and to which event they are advancing.

func (AdvancementsTo) String

func (a AdvancementsTo) String() string

type Alliance

type Alliance struct {
	Number         int     `json:"number"`
	Name           string  `json:"name"`
	Captain        int     `json:"captain"`
	CaptainDisplay string  `json:"captainDisplay"`
	Round1         int     `json:"round1,omitempty"`
	Round1Display  string  `json:"round1Display,omitempty"`
	Round2         int     `json:"round2,omitempty"`
	Round2Display  string  `json:"round2Display,omitempty"`
	Round3         *int    `json:"round3,omitempty"`
	Backup         *string `json:"backup,omitempty"`
	BackupReplaced *string `json:"backupReplaced,omitempty"`
}

Alliance is the results for one alliance in a match between two alliances

func GetEventAlliances

func GetEventAlliances(season, eventCode string) ([]*Alliance, error)

GetEventAlliances returns the alliance selectsions for the playoffs for the given event.

func (Alliance) String

func (a Alliance) String() string

type AllianceSelection

type AllianceSelection struct {
	Index  int    `json:"index"`
	Team   int    `json:"team"`
	Result string `json:"result"`
}

AllianceSelection is the alliance results for a given team

func GetAllianceSelections

func GetAllianceSelections(season, eventCode string) ([]*AllianceSelection, error)

GetAllianceSelections returns the teams that were selected into alliances for the given event.

func (AllianceSelection) String

func (a AllianceSelection) String() string

type AllianceSelections

type AllianceSelections struct {
	Selections []*AllianceSelection `json:"selections"`
	Count      int                  `json:"count"`
}

AllianceSelections is the list of alliance selections.

type Alliances

type Alliances struct {
	Alliances []*Alliance `json:"alliances"`
	Count     int         `json:"count"`
}

Alliances is the list of alliances in a given tournament

func (Alliances) String

func (a Alliances) String() string

type ApiIndex

type ApiIndex struct {
	Name                    string  `json:"name,omitempty"`
	APIVersion              string  `json:"apiVersion,omitempty"`
	ServiceMainifestName    *string `json:"serviceMainifestName,omitempty"`
	ServiceMainifestVersion *string `json:"serviceMainifestVersion,omitempty"`
	CodePackageName         string  `json:"codePackageName"`
	CodePackageVersion      string  `json:"codePackageVersion"`
	Status                  string  `json:"status,omitempty"`
	CurrentSeason           int     `json:"currentSeason,omitempty"`
	MaxSeason               int     `json:"maxSeason,omitempty"`
}

ApiIndex provives information for the FTC server API

func GetApiIndex

func GetApiIndex() (*ApiIndex, error)

GetApiIndex returns the information for the FTC server API

func (*ApiIndex) String

func (general *ApiIndex) String() string

String returns a string representation of General. In this case, it is a json string.

type Award

type Award struct {
	AwardID     int    `json:"awardId"`
	Name        string `json:"name"`
	Description string `json:"description"`
	ForPerson   bool   `json:"forPerson"`
}

Award is an award that is given in a given season

func GetAwardListing

func GetAwardListing(season string) ([]*Award, error)

GetAwardListing returns the list of awards for a given season

func (Award) String

func (a Award) String() string

type Awards

type Awards struct {
	Awards []*Award `json:"awards"`
}

Awards is the list of awards for a given season

type Championship

type Championship struct {
	Name      string `json:"name"`
	StartDate string `json:"startDate"`
	Location  string `json:"location"`
}

Championship is the information about a given regional championship.

func (Championship) String

func (c Championship) String() string

type Championships

type Championships struct {
	EventCount    int             `json:"eventCount"`
	GameName      string          `json:"gameName"`
	Kickoff       string          `json:"kickoff"`
	RookieStart   int             `json:"rookieStart"`
	TeamCount     int             `json:"teamCount"`
	Championships []*Championship `json:"fRCChampionships"`
}

Championships is the information about the season summary

func GetSeasonSummary

func GetSeasonSummary(season string) (*Championships, error)

GetSeasonSummary returns a list of the regional championships for the given season

func (Championships) String

func (c Championships) String() string

type Event

type Event struct {
	EventID       string  `json:"eventId,omitempty"`
	Code          string  `json:"code,omitempty"`
	DivisionCode  *string `json:"divisionCode,omitempty"`
	Name          string  `json:"name,omitempty"`
	Remote        bool    `json:"remote,omitempty"`
	Hybrid        bool    `json:"hybrid,omitempty"`
	FieldCount    int     `json:"fieldCount,omitempty"`
	Published     bool    `json:"published,omitempty"`
	Type          string  `json:"type,omitempty"`
	TypeName      string  `json:"typeName,omitempty"`
	RegionCode    string  `json:"regionCode,omitempty"`
	LeagueCode    *string `json:"leagueCode,omitempty"`
	DistrictCode  string  `json:"districtCode,omitempty"`
	Venue         string  `json:"venue,omitempty"`
	Address       string  `json:"address,omitempty"`
	City          string  `json:"city,omitempty"`
	Stateprov     string  `json:"stateprov,omitempty"`
	Country       string  `json:"country,omitempty"`
	Website       string  `json:"website,omitempty"`
	LiveStreamURL string  `json:"liveStreamUrl,omitempty"`
	Coordinates   *string `json:"coordinates,omitempty"`
	Webcasts      *string `json:"webcasts,omitempty"`
	Timezone      string  `json:"timezone,omitempty"`
	DateStart     Time    `json:"dateStart,omitempty"`
	DateEnd       Time    `json:"dateEnd,omitempty"`
}

Event is information about a given FTC event.

func GetEvents

func GetEvents(season string, qparms ...map[string]string) ([]*Event, error)

GetEvents returns the list of events for a given season. Supported qparms are `eventCode` and `teamNumber`, which are mutually exclusive.

func (Event) String

func (e Event) String() string

String returns a string representation of an Event. In this case, it is a json string.

type EventSchedule

type EventSchedule struct {
	Description     string          `json:"description,omitempty"`
	Field           string          `json:"field,omitempty"`
	TournamentLevel string          `json:"tournamentLevel,omitempty"`
	StartTime       string          `json:"startTime,omitempty"`
	Series          int             `json:"series,omitempty"`
	MatchNumber     int             `json:"matchNumber,omitempty"`
	Teams           []ScheduledTeam `json:"teams"`
	ModifiedOn      string          `json:"modifiedOn,omitempty"`
}

EventSchedule is the schedule at a given event

func GetEventSchedule

func GetEventSchedule(season, eventCode string, tournamentLevel MatchType, teamNumber ...string) ([]*EventSchedule, error)

GetEventSchedule gets the match schedule for a given event.

func (EventSchedule) String

func (s EventSchedule) String() string

type EventSchedules

type EventSchedules struct {
	Schedule []*EventSchedule `json:"schedule"`
}

EventSchedules is the list of event schedules

type Events

type Events struct {
	Events     []*Event `json:"events,omitempty"`
	EventCount int      `json:"eventCount,omitempty"`
}

Events is information about FTC events.

type HybridSchedule

type HybridSchedule struct {
	Description              string          `json:"description"`
	TournamentLevel          string          `json:"tournamentLevel"`
	Series                   int             `json:"series"`
	MatchNumber              int             `json:"matchNumber"`
	StartTime                string          `json:"startTime"`
	ActualStartTime          string          `json:"actualStartTime"`
	PostResultTime           string          `json:"postResultTime"`
	ScoreRedFinal            int             `json:"scoreRedFinal"`
	ScoreRedFoul             int             `json:"scoreRedFoul"`
	ScoreRedAuto             int             `json:"scoreRedAuto"`
	ScoreBlueFinal           int             `json:"scoreBlueFinal"`
	ScoreBlueFoul            int             `json:"scoreBlueFoul"`
	ScoreBlueAuto            int             `json:"scoreBlueAuto"`
	ScoreBlueDriveControlled *int            `json:"scoreBlueDriveControlled,omitempty"`
	ScoreBlueEndgame         *int            `json:"scoreBlueEndgame,omitempty"`
	RedWins                  bool            `json:"redWins"`
	BlueWins                 bool            `json:"blueWins"`
	Teams                    []ScheduledTeam `json:"teams"`
}

HybridSchedule is the result for a scheduled match at a given event

func GetHybridSchedule

func GetHybridSchedule(season, eventCode string, tournamentLevel MatchType) ([]*HybridSchedule, error)

GetHybridSchedule gets the hybrid schedule information for a given event.

func (HybridSchedule) String

func (s HybridSchedule) String() string

type HybridSchedules

type HybridSchedules struct {
	Schedule []*HybridSchedule `json:"schedule"`
}

HybridSchedules is the list of results for a schedule at a given event

type League

type League struct {
	Region           string  `json:"region,omitempty"`
	Code             string  `json:"code,omitempty"`
	Name             string  `json:"name,omitempty"`
	Remote           bool    `json:"remote,omitempty"`
	ParentLeagueCode *string `json:"parentLeagueCode,omitempty"`
	ParentLeagueName *string `json:"parentLeagueName,omitempty"`
	Location         string  `json:"location,omitempty"`
}

League is the data for a given FTC league

func GetLeagues

func GetLeagues(season string, qparms ...map[string]string) ([]*League, error)

GetLeagues returns the list of rankings for FTC leagues. Supported qparms are `regionCode` and `leagueCode`.

func (League) String

func (l League) String() string

String returns a string representation of League. In this case, it is a json string.

type LeagueMembers

type LeagueMembers struct {
	Members []int `json:"members"`
}

type Leagues

type Leagues struct {
	Leagues     []*League `json:"leagues"`
	LeagueCount int       `json:"leagueCount"`
}

Leagues is the data for the FTC leagues

type Match

type Match struct {
	ActualStartTime string       `json:"actualStartTime"`
	Description     string       `json:"description"`
	TournamentLevel string       `json:"tournamentLevel"`
	Series          int          `json:"series"`
	MatchNumber     int          `json:"matchNumber"`
	ScoreRedFinal   int          `json:"scoreRedFinal"`
	ScoreRedFoul    int          `json:"scoreRedFoul"`
	ScoreRedAuto    int          `json:"scoreRedAuto"`
	ScoreBlueFinal  int          `json:"scoreBlueFinal"`
	ScoreBlueFoul   int          `json:"scoreBlueFoul"`
	ScoreBlueAuto   int          `json:"scoreBlueAuto"`
	PostResultTime  string       `json:"postResultTime"`
	Teams           []*MatchTeam `json:"teams"`
	ModifiedOn      string       `json:"modifiedOn"`
}

Match is a match that takes place at a given event

func GetMatchResults

func GetMatchResults(season, eventCode string, tournamentLevel MatchType, teamNumber ...string) ([]*Match, error)

GetMatchResults returns the results of a given event.

func (Match) String

func (m Match) String() string

type MatchAlliance

type MatchAlliance struct {
	Alliance                string `json:"alliance"`
	Team                    int    `json:"team"`
	InitTeamProp1           bool   `json:"initTeamProp1"`
	InitTeamProp2           bool   `json:"initTeamProp2"`
	Robot1Auto              bool   `json:"robot1Auto"`
	Robot2Auto              bool   `json:"robot2Auto"`
	SpikeMarkPixel1         bool   `json:"spikeMarkPixel1"`
	SpikeMarkPixel2         bool   `json:"spikeMarkPixel2"`
	TargetBackdropPixel1    bool   `json:"targetBackdropPixel1"`
	TargetBackdropPixel2    bool   `json:"targetBackdropPixel2"`
	AutoBackdrop            int    `json:"autoBackdrop"`
	AutoBackstage           int    `json:"autoBackstage"`
	DcBackdrop              int    `json:"dcBackdrop"`
	DcBackstage             int    `json:"dcBackstage"`
	Mosaics                 int    `json:"mosaics"`
	MaxSetLine              int    `json:"maxSetLine"`
	EgRobot1                string `json:"egRobot1"`
	EgRobot2                string `json:"egRobot2"`
	Drone1                  int    `json:"drone1"`
	Drone2                  int    `json:"drone2"`
	MinorPenalties          int    `json:"minorPenalties"`
	MajorPenalties          int    `json:"majorPenalties"`
	AutoNavigatingPoints    int    `json:"autoNavigatingPoints"`
	AutoRandomizationPoints int    `json:"autoRandomizationPoints"`
	AutoBackstagePoints     int    `json:"autoBackstagePoints"`
	AutoBackdropPoints      int    `json:"autoBackdropPoints"`
	DcBackdropPoints        int    `json:"dcBackdropPoints"`
	DcBackstagePoints       int    `json:"dcBackstagePoints"`
	MosaicPoints            int    `json:"mosaicPoints"`
	SetBonusPoints          int    `json:"setBonusPoints"`
	EgLocationPoints        int    `json:"egLocationPoints"`
	EgDronePoints           int    `json:"egDronePoints"`
	AutoPoints              int    `json:"autoPoints"`
	DcPoints                int    `json:"dcPoints"`
	EndgamePoints           int    `json:"endgamePoints"`
	PenaltyPointsCommitted  int    `json:"penaltyPointsCommitted"`
	PrePenaltyTotal         int    `json:"prePenaltyTotal"`
	TotalPoints             int    `json:"totalPoints"`
}

MatchAlliance is the detailed results for a given team in a match at a given event.

func (MatchAlliance) String

func (ma MatchAlliance) String() string

type MatchScores

type MatchScores struct {
	MatchLevel    string           `json:"matchLevel"`
	MatchSeries   int              `json:"matchSeries"`
	MatchNumber   int              `json:"matchNumber"`
	Randomization int              `json:"randomization"`
	Alliances     []*MatchAlliance `json:"alliances"`
}

MatchScores is the results of a match at a given event.

func GetEventScores

func GetEventScores(season, eventCode string, tournamentLevel MatchType, teamNumber ...string) ([]*MatchScores, error)

GetEventScores returns the results for a given event

func (MatchScores) String

func (ms MatchScores) String() string

type MatchTeam

type MatchTeam struct {
	TeamNumber int    `json:"teamNumber"`
	Station    string `json:"station"`
	DQ         bool   `json:"dq"`
	OnField    bool   `json:"onField"`
}

func (MatchTeam) String

func (m MatchTeam) String() string

type MatchType

type MatchType string

Type of FTC match

const (
	QUALIFIER MatchType = "qual"
	PLAYOFF   MatchType = "playoff"
)

The types of FTC matches

type Matches

type Matches struct {
	Matches []*Match `json:"matches"`
}

Matches is the list of matches

type Ranking

type Ranking struct {
	Rank              int     `json:"rank"`
	TeamNumber        int     `json:"teamNumber"`
	DisplayTeamNumber string  `json:"displayTeamNumber"`
	TeamName          *string `json:"teamName,omitempty"`
	SortOrder1        float64 `json:"sortOrder1"`
	SortOrder2        float64 `json:"sortOrder2"`
	SortOrder3        float64 `json:"sortOrder3"`
	SortOrder4        float64 `json:"sortOrder4"`
	SortOrder5        float64 `json:"sortOrder5"`
	SortOrder6        float64 `json:"sortOrder6"`
	Wins              int     `json:"wins"`
	Losses            int     `json:"losses"`
	Ties              int     `json:"ties"`
	QualAverage       int     `json:"qualAverage"`
	DQ                int     `json:"dq"`
	MatchesPlayed     int     `json:"matchesPlayed"`
	MatchesCounted    int     `json:"matchesCounted"`
}

Ranking is the ranking for a given event.

func GetRankings

func GetRankings(season, eventCode string) ([]*Ranking, error)

GetRankings returns the team rankings in a given league.

func (Ranking) String

func (r Ranking) String() string

String returns a string representation of LeagueRanking. In this case, it is a json string.

type Rankings

type Rankings struct {
	Rankings []*Ranking `json:"rankings"`
}

Rankings is the list of rankings for a given event.

type ScheduledTeam

type ScheduledTeam struct {
	TeamNumber        int    `json:"teamNumber,omitempty"`
	DisplayTeamNumber string `json:"displayTeamNumber,omitempty"`
	Station           string `json:"station,omitempty"`
	Team              string `json:"team,omitempty"`
	TeamName          string `json:"teamName,omitempty"`
	Surrogate         bool   `json:"surrogate,omitempty"`
	NoShow            bool   `json:"noShow,omitempty"`
	DQ                *bool  `json:"dq,omitempty"`
	OnField           *bool  `json:"onField,omitempty"`
}

ScheduledTeam is the team that is scheduled at a given tournament

type Scores

type Scores struct {
	MatchScores []*MatchScores `json:"matchScores"`
}

Scores is the list of match scores at a given event.

type Team

type Team struct {
	TeamNumber        int     `json:"teamNumber,omitempty"`
	DisplayTeamNumber string  `json:"displayTeamNumber,omitempty"`
	NameFull          string  `json:"nameFull,omitempty"`
	NameShort         string  `json:"nameShort,omitempty"`
	SchoolName        *string `json:"schoolName,omitempty"`
	City              string  `json:"city,omitempty"`
	StateProv         string  `json:"stateProv,omitempty"`
	Country           string  `json:"country,omitempty"`
	Website           *string `json:"website,omitempty"`
	RookieYear        int     `json:"rookieYear,omitempty"`
	RobotName         *string `json:"robotName,omitempty"`
	DistrictCode      *string `json:"districtCode,omitempty"`
	HomeCMP           *string `json:"homeCMP,omitempty"`
	HomeRegion        *string `json:"homeRegion,omitempty"`
}

Team is information for a given FTC team.

func GetTeams

func GetTeams(season string, teamNumber ...string) ([]*Team, error)

GetTeams returns a `page` of FTC teams.

type TeamAward

type TeamAward struct {
	AwardID      int     `json:"awardId"`
	EventCode    string  `json:"eventCode"`
	Name         string  `json:"name"`
	Series       int     `json:"series"`
	TeamNumber   int     `json:"teamNumber"`
	SchoolName   *string `json:"schoolName,omitempty"`
	FullTeamName string  `json:"fullTeamName"`
	Person       *string `json:"person,omitempty"`
}

TeamAward is an award that is received by a given team

func GetEventAwards

func GetEventAwards(season, eventCode string, teamNumber ...string) ([]*TeamAward, error)

GetEventAwards gets the list of awards given at an event

func GetTeamAwards

func GetTeamAwards(season, teamNumber string, eventCode ...string) ([]*TeamAward, error)

GetTeamAwards gets the list of awards for a given team

func (TeamAward) String

func (a TeamAward) String() string

type TeamAwards

type TeamAwards struct {
	Awards []*TeamAward `json:"awards"`
}

TeamAwards is the list of awards received by a team

type Teams

type Teams struct {
	Teams          []*Team `json:"teams"`
	TeamCountTotal int     `json:"teamCountTotal"`
	TeamCountPage  int     `json:"teamCountPage"`
	PageCurrent    int     `json:"pageCurrent"`
	PageTotal      int     `json:"pageTotal"`
}

Teams returns a list of FTC teams. The information is returned in `pages`, so multiple requests may be required to get all FTC teams.

func (*Teams) String

func (teams *Teams) String() string

String returns a string representation of Teams. In this case, it is a json string.

type Time

type Time time.Time

func (Time) Format

func (ft Time) Format() string

Format function for printing the date

func (Time) MarshalJSON

func (ft Time) MarshalJSON() ([]byte, error)

MarshalJSON returns a JSON encoding of the time

func (Time) String

func (ft Time) String() string

String function for printing the date

func (*Time) UnmarshalJSON

func (ft *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON parses the json time into a time value

Jump to

Keyboard shortcuts

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