vatusa

package
v0.0.0-...-0ad4d90 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddVisitingController

func AddVisitingController(cid string) (int, error)

AddVisitingController adds a visitor to the visiting roster at VATUSA.

func DeleteTrainingNote

func DeleteTrainingNote(id string) (int, error)

func EditTrainingNote

func EditTrainingNote(id, studentcid, instructorcid, position string, sessiondate time.Time, duration, notes, location string) (int, error)

func GetUserFacility

func GetUserFacility(cid string) (string, error)

GetFacility returns the Facility for a user in VATUSA.

If a user is not in VATUSA's roster, it will return an error of "user not found". Other errors will be returned as-is.

VATUSA-ism: a controller not assigned to a facility will be in "ZAE". These can be controllers that are in other divisions/regions, so you should also check the division/region from the VATSIM API pkg's GetLocation method.

func IsVisitorEligible

func IsVisitorEligible(cid string) (bool, map[string]interface{}, error)

Check if user is eligible to be a visitor Return: eligible (bool), raw data (map[string]interface{}), error

func RemoveController

func RemoveController(cid string, by uint, reason string) (int, error)

RemoveController removes a home controller from the roster at VATUSA.

func RemoveVisitingController

func RemoveVisitingController(cid string, by uint, reason string) (int, error)

RemoveVisitingController removes a controller from the visiting roster at VATUSA.

func SubmitTrainingNote

func SubmitTrainingNote(studentcid, instructorcid, position string, sessiondate time.Time, duration, notes, location string) (int, int, error)

Types

type TransferChecklistStruct

type TransferChecklistStruct struct {
	Data map[string]interface{} `json:"data"`
}

type VATUSAController

type VATUSAController struct {
	CID          int       `json:"cid"`
	FirstName    string    `json:"fname"`
	LastName     string    `json:"lname"`
	Email        string    `json:"email"`
	Rating       int       `json:"rating"`
	Facility     string    `json:"facility"`
	Membership   string    `json:"membership"`
	RatingShort  string    `json:"rating_short"`
	FacilityJoin time.Time `json:"facility_join"`
}

func GetFacilityRoster

func GetFacilityRoster(membership string) ([]VATUSAController, error)

GetFacilityRoster will grab the facility roster from VATUSA. If membership is not specified, or it is not "home" or "visit", it will return both rosters.

type VATUSAFacility

type VATUSAFacility struct {
	Info  *VATUSAFacilityInfo    `json:"info"`
	Roles []*VATUSAFacilityRole  `json:"roles"`
	Stats map[string]interface{} `json:"stats"`
}

func GetFacility

func GetFacility(id string) (*VATUSAFacility, error)

type VATUSAFacilityInfo

type VATUSAFacilityInfo struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	URL    string `json:"url"`
	Region int    `json:"region"`
	ATM    int    `json:"atm"`
	DATM   int    `json:"datm"`
	TA     int    `json:"ta"`
	EC     int    `json:"ec"`
	FE     int    `json:"fe"`
	WM     int    `json:"wm"`
}

type VATUSAFacilityRole

type VATUSAFacilityRole struct {
	ID       int    `json:"id"`
	CID      int    `json:"cid"`
	Facility string `json:"facility"`
	Role     string `json:"role"`
}

Jump to

Keyboard shortcuts

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