Documentation ¶
Index ¶
- type Aircraft
- type Airline
- type Airport
- type Airports
- type Array
- type City
- type Client
- func (c *Client) Aircraft(ctx context.Context) ([]Aircraft, error)
- func (c *Client) AircraftRaw(ctx context.Context) ([]json.RawMessage, error)
- func (c *Client) Airlines(ctx context.Context) ([]Airline, error)
- func (c *Client) AirlinesRaw(ctx context.Context) ([]json.RawMessage, error)
- func (c *Client) Airport(ctx context.Context, airportCode string) (Airport, error)
- func (c *Client) AirportRaw(ctx context.Context, airportCode string) (json.RawMessage, error)
- func (c *Client) Airports(ctx context.Context) ([]Airport, error)
- func (c *Client) AirportsRaw(ctx context.Context) ([]json.RawMessage, error)
- func (c *Client) Cities(ctx context.Context) ([]City, error)
- func (c *Client) CitiesRaw(ctx context.Context) ([]json.RawMessage, error)
- func (c *Client) Countries(ctx context.Context) ([]Country, error)
- func (c *Client) CountriesRaw(ctx context.Context) ([]json.RawMessage, error)
- func (c *Client) FlightSchedules(ctx context.Context, airlines []common.AirlineIdentifier, ...) ([]FlightSchedule, error)
- func (c *Client) FlightSchedulesRaw(ctx context.Context, airlines []common.AirlineIdentifier, ...) error
- type ClientOption
- type Coordinate
- type Country
- type DataElement
- type DaysOfOperation
- type FlightSchedule
- type FlightSchedulesOption
- type Leg
- type Name
- type Names
- type PeriodOfOperation
- type Position
- type UTCDate
- type WithAircraftTypes
- type WithAirlines
- type WithDaysOfOperation
- type WithDestination
- type WithEndDate
- type WithFlightNumber
- type WithFlightNumberRange
- type WithOrigin
- type WithStartDate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Airport ¶
type Airport struct { Code string `json:"AirportCode"` Position Position `json:"Position"` CityCode string `json:"CityCode"` CountryCode string `json:"CountryCode"` LocationType string `json:"LocationType"` Names Names `json:"Names"` UtcOffset string `json:"UtcOffset"` TimeZoneId string `json:"TimeZoneId"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(clientId, clientSecret string, opts ...ClientOption) *Client
func (*Client) AircraftRaw ¶
func (*Client) AirlinesRaw ¶
func (*Client) AirportRaw ¶
func (*Client) AirportsRaw ¶
func (*Client) CountriesRaw ¶
func (*Client) FlightSchedules ¶
func (c *Client) FlightSchedules(ctx context.Context, airlines []common.AirlineIdentifier, startDate, endDate xtime.LocalDate, daysOfOperation []time.Weekday, options ...FlightSchedulesOption) ([]FlightSchedule, error)
func (*Client) FlightSchedulesRaw ¶
type ClientOption ¶
type ClientOption func(c *Client)
func WithBaseUrl ¶
func WithBaseUrl(baseUrl string) ClientOption
func WithHttpClient ¶
func WithHttpClient(httpClient *http.Client) ClientOption
func WithLeeway ¶
func WithLeeway(leeway time.Duration) ClientOption
func WithRateLimiter ¶
func WithRateLimiter(limiter *rate.Limiter) ClientOption
type Coordinate ¶
type DataElement ¶
type DaysOfOperation ¶
func (*DaysOfOperation) UnmarshalJSON ¶
func (d *DaysOfOperation) UnmarshalJSON(bytes []byte) error
type FlightSchedule ¶
type FlightSchedule struct { Airline string `json:"airline"` FlightNumber int `json:"flightNumber"` Suffix string `json:"suffix"` PeriodOfOperationUTC PeriodOfOperation `json:"periodOfOperationUTC"` Legs []Leg `json:"legs"` DataElements []DataElement `json:"dataElements"` }
func (FlightSchedule) DataElementsForSequence ¶
func (fs FlightSchedule) DataElementsForSequence(sequenceNumber int) map[int]string
type FlightSchedulesOption ¶
type Leg ¶
type Leg struct { SequenceNumber int `json:"sequenceNumber"` Origin string `json:"origin"` Destination string `json:"destination"` ServiceType string `json:"serviceType"` AircraftOwner string `json:"aircraftOwner"` AircraftType string `json:"aircraftType"` AircraftConfigurationVersion string `json:"aircraftConfigurationVersion"` Registration string `json:"registration"` Op bool `json:"op"` AircraftDepartureTimeUTC int `json:"aircraftDepartureTimeUTC"` AircraftDepartureTimeDateDiffUTC int `json:"aircraftDepartureTimeDateDiffUTC"` AircraftDepartureTimeVariation int `json:"aircraftDepartureTimeVariation"` AircraftArrivalTimeUTC int `json:"aircraftArrivalTimeUTC"` AircraftArrivalTimeDateDiffUTC int `json:"aircraftArrivalTimeDateDiffUTC"` AircraftArrivalTimeVariation int `json:"aircraftArrivalTimeVariation"` }
type Name ¶
func (*Name) UnmarshalJSON ¶
type PeriodOfOperation ¶
type PeriodOfOperation struct { StartDate UTCDate `json:"startDate"` EndDate UTCDate `json:"endDate"` DaysOfOperation DaysOfOperation `json:"daysOfOperation"` }
type Position ¶
type Position struct {
Coordinate Coordinate `json:"Coordinate"`
}
type WithAircraftTypes ¶
type WithAircraftTypes []string
func (WithAircraftTypes) Apply ¶
func (opt WithAircraftTypes) Apply(q url.Values)
type WithAirlines ¶
type WithAirlines []common.AirlineIdentifier
func (WithAirlines) Apply ¶
func (opt WithAirlines) Apply(q url.Values)
type WithDaysOfOperation ¶
func (WithDaysOfOperation) Apply ¶
func (opt WithDaysOfOperation) Apply(q url.Values)
type WithDestination ¶
type WithDestination string
func (WithDestination) Apply ¶
func (opt WithDestination) Apply(q url.Values)
type WithEndDate ¶
func (WithEndDate) Apply ¶
func (opt WithEndDate) Apply(q url.Values)
type WithFlightNumber ¶
type WithFlightNumber int
func (WithFlightNumber) Apply ¶
func (opt WithFlightNumber) Apply(q url.Values)
type WithFlightNumberRange ¶
type WithFlightNumberRange [2]int
func (WithFlightNumberRange) Apply ¶
func (opt WithFlightNumberRange) Apply(q url.Values)
type WithOrigin ¶
type WithOrigin string
func (WithOrigin) Apply ¶
func (opt WithOrigin) Apply(q url.Values)
type WithStartDate ¶
func (WithStartDate) Apply ¶
func (opt WithStartDate) Apply(q url.Values)
Click to show internal directories.
Click to hide internal directories.