Documentation
¶
Index ¶
- Constants
- Variables
- type ATIS
- type AuditLogEntry
- type AuditLogResponse
- type Controller
- type CoreAPISession
- func (s *CoreAPISession) AddSuggestion(entry *NewSuggestion) (su *Suggestions, e error)
- func (s *CoreAPISession) DeleteSuggestion(id string) (d bool, e error)
- func (s *CoreAPISession) GetAllSuggestions() (su []*Suggestions, e error)
- func (s *CoreAPISession) GetSuggestion(id string) (su *Suggestions, e error)
- func (s *CoreAPISession) UupdateSuggestion(id string, entry *Suggestions) (su *Suggestions, e error)
- type DataFeed
- type FBO
- type FCPAuditLogAdd
- type FCPCallsignResponse
- type FCPFBOs
- type FCPFullUser
- type FCPLimitedUser
- type FCPSectors
- type FCPSession
- func (s FCPSession) AddFCPUser(UserID *FCPUserAdd) (a *FCPFullUser, e error)
- func (s FCPSession) DeleteFCPUser(UserID string) (su *SuccessResponse, e error)
- func (s FCPSession) GetAllFBOs() (f *FCPFBOs, e error)
- func (s FCPSession) GetAllFCPUsers() (u []*FCPLimitedUser, e error)
- func (s FCPSession) GetFBO(Icao string) (f *FBO, e error)
- func (s FCPSession) GetFCPCallsign(UserId string) (c *FCPCallsignResponse, e error)
- func (s FCPSession) GetFCPUser(UserId string) (u *FCPLimitedUser, e error)
- func (s FCPSession) GetFCPUsersBirthdays() (u []*string, e error)
- func (s FCPSession) GetSectors() (se *FCPSectors, e error)
- func (s FCPSession) PostAuditLogEntry(UserId string, entry AuditLogEntry) (a *AuditLogResponse, e error)
- type FCPUserAdd
- type FCPUserAircraft
- type FlightPlan
- type GeneralInfo
- type MemberDiscord
- type NewSuggestion
- type NotFoundResource
- type Pilot
- type PreFile
- type Sectors
- type SuccessResponse
- type Suggestions
- type VATSIMSession
- type VATSIMUserHours
Constants ¶
View Source
const VERSION = "0.0.5"
Variables ¶
View Source
var ( VATSIMDataFeedVersion = "3" VATSIMAPIVersion = "2" EndpointFCP = func(Env string) string { if Env == "production" { return "https://flightcrew.thepilotclub.org/api" } else if Env == "beta" { return "https://flightcrew-beta.thepilotclub.org/api" } else { return "" } } ENDPOINTCoreAPI = "https://api.thepilotclub.org" //ENDPOINTCoreAPI = "http://127.0.0.1:3000" EndpointVATSIMAPI = "https://api.vatsim.net/" EndpointVATSIMData = "https://data.vatsim.net/" EndPointFCPALLFBOs = func(env string) string { return EndpointFCP(env) + "/fbos" } EndPointFCPFBO = func(icao string, env string) string { return EndpointFCP(env) + "/fbo/" + icao } EndPointFCPSectors = func(env string) string { return EndpointFCP(env) + "/sectors" } ENDPOINTFCPGetAllUsers = func(env string) string { return EndpointFCP(env) + "/users/get" } ENDPOINTFCPUser = func(userId string, env string) string { return EndpointFCP(env) + "/users/find/" + userId } ENDPOINTFCPUserBirthdays = func(env string) string { return EndpointFCP(env) + "/users/birthdays" } ENDPOINTFCPUserAdd = func(env string) string { return EndpointFCP(env) + "/users/new" } ENDPOINTFCPUserDelete = func(userId string, env string) string { return EndpointFCP(env) + "/users/find/" + userId + "/delete" } ENDPOINTFCPUserCallsign = func(userId string, env string) string { return EndpointFCP(env) + "/users/find/" + userId + "/callsign" } ENDPOINTFCPUserAuditLogAdd = func(userId string, env string) string { return EndpointFCP(env) + "/users/find/" + userId + "/audit-logs/new" } ENDPOINTCoreAPIAllSuggestions = ENDPOINTCoreAPI + "/suggestions/all" ENDPOINTCoreAPINewSuggestion = ENDPOINTCoreAPI + "/suggestions/new" ENDPOINTCoreAPISuggestion = func(id string) string { return ENDPOINTCoreAPI + "/suggestions/" + id } EndpointVATSIMDataFeed = EndpointVATSIMData + "v" + VATSIMDataFeedVersion + "/vatsim-data.json" EndpointVATSIMDiscordId = func(userId string) string { return EndpointVATSIMAPI + "v" + VATSIMAPIVersion + "/members/discord/" + userId } EndpointVATSIMUserHours = func(userId string) string { return EndpointVATSIMAPI + "v" + VATSIMAPIVersion + "/members/" + userId + "/stats" } )
Functions ¶
This section is empty.
Types ¶
type ATIS ¶
type ATIS struct {
CID int `json:"cid,omitempty"`
Name string `json:"name,omitempty"`
Callsign string `json:"callsign,omitempty"`
Frequency string `json:"frequency,omitempty"`
Facility int `json:"facility,omitempty"`
Rating int `json:"rating,omitempty"`
ATISCode string `json:"atis_code,omitempty"`
Server string `json:"server,omitempty"`
VisualRange int `json:"visual_range,omitempty"`
TextAtis []string `json:"text_atis,omitempty"`
LogonTime string `json:"logon_time,omitempty"`
}
type AuditLogEntry ¶
type AuditLogResponse ¶
type AuditLogResponse struct {
Success string `json:"success,omitempty"`
Entry AuditLogEntry `json:"entry,omitempty"`
}
type Controller ¶
type Controller struct {
CID int `json:"cid,omitempty"`
Name string `json:"name,omitempty"`
Callsign string `json:"callsign,omitempty"`
Frequency string `json:"frequency,omitempty"`
Facility int `json:"facility,omitempty"`
Rating int `json:"rating,omitempty"`
Server string `json:"server,omitempty"`
VisualRange int `json:"visual_range,omitempty"`
TextAtis []string `json:"text_atis,omitempty"`
LogonTime string `json:"logon_time,omitempty"`
}
type CoreAPISession ¶
func NewCoreAPISession ¶
func NewCoreAPISession(ApiKey string) (c *CoreAPISession, e error)
func (*CoreAPISession) AddSuggestion ¶
func (s *CoreAPISession) AddSuggestion(entry *NewSuggestion) (su *Suggestions, e error)
func (*CoreAPISession) DeleteSuggestion ¶
func (s *CoreAPISession) DeleteSuggestion(id string) (d bool, e error)
func (*CoreAPISession) GetAllSuggestions ¶
func (s *CoreAPISession) GetAllSuggestions() (su []*Suggestions, e error)
func (*CoreAPISession) GetSuggestion ¶
func (s *CoreAPISession) GetSuggestion(id string) (su *Suggestions, e error)
func (*CoreAPISession) UupdateSuggestion ¶
func (s *CoreAPISession) UupdateSuggestion(id string, entry *Suggestions) (su *Suggestions, e error)
type DataFeed ¶
type DataFeed struct {
General *GeneralInfo `json:"general,omitempty"`
Pilots []Pilot `json:"pilots,omitempty"`
Controllers []Controller `json:"controllers,omitempty"`
ATISs []ATIS `json:"atis,omitempty"`
}
type FBO ¶
type FBO struct {
ICAO string `json:"icao,omitempty"`
Name string `json:"name,omitempty"`
Region string `json:"region,omitempty"`
Fuel string `json:"fuel,omitempty"`
Focus string `json:"focus,omitempty"`
PublicNotes string `json:"publicNotes,omitempty"`
Sectors []Sectors `json:"sectors,omitempty"`
}
type FCPAuditLogAdd ¶
type FCPCallsignResponse ¶
type FCPCallsignResponse struct {
Callsign int `json:"tpcCallsign,omitempty"`
}
type FCPFullUser ¶
type FCPFullUser struct {
ID string `json:"id"`
DiscordID string `json:"discordId,omitempty"`
DiscordUsername string `json:"discordUsername,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Callsign int `json:"callsign,omitempty"`
VATSIMCid int `json:"vatsimCid,omitempty"`
Email string `json:"email,omitempty"`
HomeAirport string `json:"homeAirport,omitempty"`
ChartersCode string `json:"chartersCode,omitempty"`
Bio string `json:"bio,omitempty"`
Status string `json:"status,omitempty"`
AircraftHangar []FCPUserAircraft `json:"aircraftHangar,omitempty"`
}
type FCPLimitedUser ¶
type FCPLimitedUser struct {
ID string `json:"id,omitempty"`
DiscordID string `json:"discordId,omitempty"`
Callsign int `json:"callsign,omitempty"`
VATSIMCid int `json:"vatsimCid,omitempty"`
HomeAirport string `json:"homeAirport,omitempty"`
ChartersCode string `json:"chartersCode,omitempty"`
Bio string `json:"bio,omitempty"`
AircraftHangar []FCPUserAircraft `json:"aircraftHangar,omitempty"`
}
type FCPSectors ¶
type FCPSectors struct {
Sectors []Sectors `json:"sectors,omitempty"`
}
type FCPSession ¶
func NewFCPSession ¶
func NewFCPSession(ApiKey string, Env string) (f *FCPSession, e error)
func (FCPSession) AddFCPUser ¶
func (s FCPSession) AddFCPUser(UserID *FCPUserAdd) (a *FCPFullUser, e error)
func (FCPSession) DeleteFCPUser ¶
func (s FCPSession) DeleteFCPUser(UserID string) (su *SuccessResponse, e error)
func (FCPSession) GetAllFBOs ¶
func (s FCPSession) GetAllFBOs() (f *FCPFBOs, e error)
func (FCPSession) GetAllFCPUsers ¶
func (s FCPSession) GetAllFCPUsers() (u []*FCPLimitedUser, e error)
func (FCPSession) GetFCPCallsign ¶
func (s FCPSession) GetFCPCallsign(UserId string) (c *FCPCallsignResponse, e error)
func (FCPSession) GetFCPUser ¶
func (s FCPSession) GetFCPUser(UserId string) (u *FCPLimitedUser, e error)
func (FCPSession) GetFCPUsersBirthdays ¶
func (s FCPSession) GetFCPUsersBirthdays() (u []*string, e error)
func (FCPSession) GetSectors ¶
func (s FCPSession) GetSectors() (se *FCPSectors, e error)
func (FCPSession) PostAuditLogEntry ¶
func (s FCPSession) PostAuditLogEntry(UserId string, entry AuditLogEntry) (a *AuditLogResponse, e error)
type FCPUserAdd ¶
type FCPUserAdd struct {
UserID string `json:"id"`
}
type FCPUserAircraft ¶
type FlightPlan ¶
type FlightPlan struct {
FlightRules string `json:"flight_rules,omitempty"`
Aircraft string `json:"aircraft,omitempty"`
AircraftFAA string `json:"aircraft_faa,omitempty"`
AircraftShort string `json:"aircraft_short,omitempty"`
Departure string `json:"departure,omitempty"`
Arrival string `json:"arrival,omitempty"`
Alternate string `json:"alternate,omitempty"`
CruiseTAS string `json:"cruise_tas,omitempty"`
Altitude string `json:"altitude,omitempty"`
DepTime string `json:"deptime,omitempty"`
EnrouteTime string `json:"enroute_time,omitempty"`
FuelTime string `json:"fuel_time,omitempty"`
Remarks string `json:"remarks,omitempty"`
Route string `json:"route,omitempty"`
RevisionID int `json:"revision_id,omitempty"`
AssignedTransponder string `json:"assigned_transponder,omitempty"`
}
type GeneralInfo ¶
type GeneralInfo struct {
Version int `json:"version,omitempty"`
Reload int `json:"reload,omitempty"`
Update string `json:"update,omitempty"`
UpdateTimestamp string `json:"update_timestamp,omitempty"`
ConnectedClients int `json:"connected_clients,omitempty"`
UniqueUsers int `json:"unique_users,omitempty"`
}
type MemberDiscord ¶
type NewSuggestion ¶
type NotFoundResource ¶
type NotFoundResource struct {
Detail string `json:"detail,omitempty"`
}
type Pilot ¶
type Pilot struct {
CID int `json:"cid,omitempty"`
Name string `json:"name,omitempty"`
Callsign string `json:"callsign,omitempty"`
Server string `json:"server,omitempty"`
PilotRating int `json:"pilot_rating,omitempty"`
MilitaryRating int `json:"military_rating,omitempty"`
Latitude float64 `json:"latitude,omitempty"`
Longitude float64 `json:"longitude,omitempty"`
Altitude int `json:"altitude,omitempty"`
Groundspeed int `json:"groundspeed,omitempty"`
Transponder string `json:"transponder,omitempty"`
Heading int `json:"heading,omitempty"`
QNH_I_Hg float64 `json:"qnh_i_hg,omitempty"`
QNH_MB int `json:"qnh_mb,omitempty"`
FlightPlan *FlightPlan `json:"flight_plan,omitempty"`
LogonTime string `json:"logon_time,omitempty"`
LastUpdated string `json:"last_updated,omitempty"`
}
type PreFile ¶
type PreFile struct {
CID int `json:"cid,omitempty"`
Name string `json:"name,omitempty"`
Callsign string `json:"callsign,omitempty"`
FlightPlan *FlightPlan `json:"flight_plan,omitempty"`
LastUpdate string `json:"last_updated,omitempty"`
}
type SuccessResponse ¶
type SuccessResponse struct {
Success string `json:"success,omitempty"`
}
type Suggestions ¶
type Suggestions struct {
ID string `json:"id,omitempty"`
StatsID int `json:"statsId,omitempty"`
DiscordId string `json:"discordId,omitempty"`
IdeaText string `json:"ideaText,omitempty"`
Reason string `json:"reason,omitempty"`
MessageID string `json:"messageId,omitempty"`
ChannelID string `json:"channelId,omitempty"`
ActionUserID string `json:"actionUserId,omitempty"`
}
type VATSIMSession ¶
func NewVATSIMSession ¶
func NewVATSIMSession(ApiKey string) (v *VATSIMSession, e error)
func (*VATSIMSession) GetUserDiscordID ¶
func (v *VATSIMSession) GetUserDiscordID(UserID string) (m *MemberDiscord, err error)
func (*VATSIMSession) GetUserHours ¶
func (v *VATSIMSession) GetUserHours(UserID string) (m *VATSIMUserHours, err error)
func (*VATSIMSession) GetVatsimDataFeed ¶
func (v *VATSIMSession) GetVatsimDataFeed() (df *DataFeed, err error)
type VATSIMUserHours ¶
type VATSIMUserHours struct {
ID int `json:"id,omitempty"`
ATC float64 `json:"atc,omitempty"`
Pilot float64 `json:"pilot,omitempty"`
S1 float64 `json:"s1,omitempty"`
S2 float64 `json:"s2,omitempty"`
S3 float64 `json:"s3,omitempty"`
C1 float64 `json:"c1,omitempty"`
C2 float64 `json:"c2,omitempty"`
C3 float64 `json:"c3,omitempty"`
I1 float64 `json:"i1,omitempty"`
I2 float64 `json:"i2,omitempty"`
I3 float64 `json:"i3,omitempty"`
SUP float64 `json:"sup,omitempty"`
ADM float64 `json:"adm,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.