go-aviasales-api: github.com/liderman/go-aviasales-api Index | Files

package aviasales

import "github.com/liderman/go-aviasales-api"

Index

Package Files

airline-directions.go aviasales-api.go city-directions.go data-airlines-alliances.go data-airlines.go data-airports.go data-cities.go data-countries.go data-planes.go data-routes.go prices-calendar.go prices-cheap.go prices-direct.go prices-latest.go prices-month-matrix.go prices-nearest-places-matrix.go prices-week-matrix.go special-offers.go

type Airline Uses

type Airline struct {
    Name     string `json:"name" bson:"name"`
    Alias    string `json:"alias" bson:"alias"`
    Iata     string `json:"iata" bson:"iata"`
    Icao     string `json:"icao" bson:"icao"`
    Callsign string `json:"callsign" bson:"callsign"`
    Country  string `json:"country" bson:"country"`
    IsActive bool   `json:"is_active" bson:"is_active"`
}

type Airport Uses

type Airport struct {
    Code             string            `json:"code" bson:"code"`
    Name             string            `json:"name" bson:"name"`
    Coordinates      Coordinates       `json:"coordinates" bson:"coordinates"`
    TimeZone         string            `json:"time_zone" bson:"time_zone"`
    CountryCode      string            `json:"country_code" bson:"country_code"`
    CityCode         string            `json:"city_code" bson:"city_code"`
    NameTranslations map[string]string `json:"name_translations" bson:"name_translations"`
}

type Alliance Uses

type Alliance struct {
    Name     string   `json:"name" bson:"name"`
    Airlines []string `json:"alias" bson:"alias"`
}

type AviasalesApi Uses

type AviasalesApi struct {
    // contains filtered or unexported fields
}

func NewAviasalesApi Uses

func NewAviasalesApi(token string) *AviasalesApi

NewAviasalesApi creates a new instance AviasalesApi.

func (*AviasalesApi) AirlineDirections Uses

func (a *AviasalesApi) AirlineDirections(airlineCode string, limit int) (airlineDirections DataAirlineDirections, err error)

AirlineDirections returns the ways in which the airline operates flights sorted by popularity.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#08

Example URI: http://api.travelpayouts.com/v1/airline-directions?airline_code=SU&limit=10&token=YOUR_TOKEN

func (*AviasalesApi) CityDirections Uses

func (a *AviasalesApi) CityDirections(origin string) (flights DataCityDirectionsFlight, err error)

CityDirections returns most popular destinations from the specified city.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#20

Example URI: http://api.travelpayouts.com/v1/city-directions?origin=MOW&token=YOUR_TOKEN

func (*AviasalesApi) DataAirlines Uses

func (a *AviasalesApi) DataAirlines() (airlines []Airline, err error)

DataAirlines a list of airlines from the database.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#12

Example URI: http://api.travelpayouts.com/data/airlines.json

func (*AviasalesApi) DataAirlinesAlliances Uses

func (a *AviasalesApi) DataAirlinesAlliances() (airlinesAlliances []Alliance, err error)

DataAirlinesAlliances a list of alliances from the database.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#13

Example URI: http://api.travelpayouts.com/data/airlines_alliances.json

func (*AviasalesApi) DataAirports Uses

func (a *AviasalesApi) DataAirports() (airports []Airport, err error)

DataAirports a list of airports in the database.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#11

Example URI: http://api.travelpayouts.com/data/airports.json

func (*AviasalesApi) DataCities Uses

func (a *AviasalesApi) DataCities() (cities []City, err error)

DataCities returns a list of cities in the database.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#10

Example URI: http://api.travelpayouts.com/data/cities.json

func (*AviasalesApi) DataCountries Uses

func (a *AviasalesApi) DataCountries() (countries []Country, err error)

DataCountries returns a list of countries from the database.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#09

Example URI: http://api.travelpayouts.com/data/countries.json

func (*AviasalesApi) DataPlanes Uses

func (a *AviasalesApi) DataPlanes() (planes []Plane, err error)

DataPlanes a list of planes from the database.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#14

Example URI: http://api.travelpayouts.com/data/planes.json

func (*AviasalesApi) DataRoutes Uses

func (a *AviasalesApi) DataRoutes() (routes []Route, err error)

DataRoutes a list of routes from the database.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#15

Example URI: http://api.travelpayouts.com/data/routes.json

func (*AviasalesApi) PricesCalendar Uses

func (a *AviasalesApi) PricesCalendar(input InputPricesCalendar) (flights DataFlightCalendar, err error)

PricesCalendar returns the cheapest ticket (without transfer, with one or two changes) for the specified direction for each day of the selected month.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#07

Example URI: http://api.travelpayouts.com/v1/prices/calendar?depart_date=2016-11&origin=MOW&destination=BCN&calendar_type=departure_date&token=YOUR_TOKEN

func (*AviasalesApi) PricesCheap Uses

func (a *AviasalesApi) PricesCheap(input InputPricesCheap) (flights DataFlight, err error)

PricesCheap returns the cheapest direct, as well as 1 and 2 transfers to the chosen direction with filters by date of departure and return. Tickets return flight there and back. Note! If the request specifies the old date, as a result of his work is not an error, but no data will not be back.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#05

Example URI: http://api.travelpayouts.com/v1/prices/cheap?origin=MOW&destination=HKT&depart_date=2016-11&return_date=2016-12&token=YOUR_TOKEN

func (*AviasalesApi) PricesDirect Uses

func (a *AviasalesApi) PricesDirect(input InputPricesCheap) (flights DataFlight, err error)

PricesDirect returns the cheapest ticket direct to the chosen direction with filters by date of departure and return.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#06

Example URI: http://api.travelpayouts.com/v1/prices/direct?origin=MOW&destination=LED&depart_date=2016-11&return_date=2016-12&token=YOUR_TOKEN

func (*AviasalesApi) PricesLatest Uses

func (a *AviasalesApi) PricesLatest(input InputPricesLatest) (prices DataPrice, err error)

PricesLatest returns a list of the prices found aviasales users in the last 48 hours, in accordance with the exposed filters. Note! If you do not specify a starting point and destination, the API returns 30 for the cheapest tickets, which were found in the last 48 hours.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#02

Example URI: http://api.travelpayouts.com/v2/prices/latest?currency=rub&period_type=year&page=1&limit=30&show_to_affiliates=true&sorting=price&trip_class=0&token=YOUR_TOKEN

func (*AviasalesApi) PricesMonthMatrix Uses

func (a *AviasalesApi) PricesMonthMatrix(input InputPricesMonthMatrix) (prices DataPrice, err error)

PricesMonthMatrix returns the price for each day of the month, grouped by the number of transfer. Note! If you do not specify a starting point and destination, the API returns a list of the cheapest tickets, which were found in the last 48 hours.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#03

Example URI: http://api.travelpayouts.com/v2/prices/month-matrix?currency=rub&origin=LED&destination=HKT&show_to_affiliates=true&token=YOUR_TOKEN

func (*AviasalesApi) PricesNearestPlacesMatrix Uses

func (a *AviasalesApi) PricesNearestPlacesMatrix(input InputPricesNearestPlacesMatrix) (prices DataPriceNearest, err error)

PricesNearestPlacesMatrix returns prices directions between nearest to the target cities. Note! If you do not specify a starting point and destination, the API returns a list of the cheapest tickets, which were found in the last 48 hours.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#04

Example URI: http://api.travelpayouts.com/v2/prices/nearest-places-matrix?currency=rub&origin=LED&destination=HKT&show_to_affiliates=true&token=YOUR_TOKEN

func (*AviasalesApi) PricesWeekMatrix Uses

func (a *AviasalesApi) PricesWeekMatrix(input InputPricesWeekMatrix) (prices DataPrice, err error)

PricesWeekMatrix calendar of prices for a week. Returns prices nearest the target dates.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#19

Example URI: http://api.travelpayouts.com/v2/prices/week-matrix?currency=rub&origin=LED&destination=HKT&show_to_affiliates=true&depart_date=2016-03-04&return_date=2016-03-18&token=YOUR_TOKEN

func (*AviasalesApi) SetLogger Uses

func (a *AviasalesApi) SetLogger(logger LoggerInterface)

func (*AviasalesApi) SpecialOffers Uses

func (a *AviasalesApi) SpecialOffers() (specialOffers []SpecialOffer, err error)

SpecialOffers returns latest special offers from airlines.

Documentation: https://support.travelpayouts.com/hc/ru/articles/203956163#18

Example URI: http://api.travelpayouts.com/v2/prices/special-offers?token=YOUR_TOKEN

type City Uses

type City struct {
    Code             string            `json:"code" bson:"code"`
    Name             string            `json:"name" bson:"name"`
    Coordinates      Coordinates       `json:"coordinates" bson:"coordinates"`
    TimeZone         string            `json:"time_zone" bson:"time_zone"`
    CountryCode      string            `json:"country_code" bson:"country_code"`
    NameTranslations map[string]string `json:"name_translations" bson:"name_translations"`
}

type Coordinates Uses

type Coordinates struct {
    Lon float64 `json:"lon" bson:"lon"`
    Lan float64 `json:"lat" bson:"lat"`
}

type Country Uses

type Country struct {
    Code             string            `json:"code" bson:"code"`
    Name             string            `json:"name" bson:"name"`
    Currency         string            `json:"currency" bson:"currency"`
    NameTranslations map[string]string `json:"name_translations" bson:"name_translations"`
}

type DataAirlineDirections Uses

type DataAirlineDirections struct {
    Success  bool           `json:"success" bson:"success"`
    Data     map[string]int `json:"data" bson:"data"`
    Error    string         `json:"error" bson:"error"`
    Currency string         `json:"currency" bson:"currency"`
}

type DataCityDirectionsFlight Uses

type DataCityDirectionsFlight struct {
    Success bool              `json:"success" bson:"success"`
    Data    map[string]Flight `json:"data" bson:"data"`
}

type DataFlight Uses

type DataFlight struct {
    Success bool                         `json:"success" bson:"success"`
    Data    map[string]map[string]Flight `json:"data" bson:"data"`
}

type DataFlightCalendar Uses

type DataFlightCalendar struct {
    Success bool                      `json:"success" bson:"success"`
    Data    map[string]FlightCalendar `json:"data" bson:"data"`
}

type DataPrice Uses

type DataPrice struct {
    Success bool    `json:"success" bson:"success"`
    Data    []Price `json:"data" bson:"success"`
}

type DataPriceNearest Uses

type DataPriceNearest struct {
    Success bool           `json:"success" bson:"success"`
    Data    []PriceNearest `json:"data" bson:"data"`
}

type Flight Uses

type Flight struct {
    Price        int    `json:"price" bson:"price"`
    Airline      string `json:"airline" bson:"airline"`
    FlightNumber int    `json:"flight_number" bson:"flight_number"`
    DepartureAt  string `json:"departure_at" bson:"departure_at"`
    ReturnAt     string `json:"return_at" bson:"return_at"`
    ExpiresAt    string `json:"expires_at" bson:"expires_at"`
}

type FlightCalendar Uses

type FlightCalendar struct {
    Price        int    `json:"price" bson:"price"`
    Airline      string `json:"airline" bson:"airline"`
    FlightNumber int    `json:"flight_number" bson:"flight_number"`
    DepartureAt  string `json:"departure_at" bson:"departure_at"`
    ReturnAt     string `json:"return_at" bson:"return_at"`
    ExpiresAt    string `json:"expires_at" bson:"expires_at"`
    Origin       string `json:"origin" bson:"origin"`
    Destination  string `json:"destination" bson:"destination"`
    Transfers    int    `json:"transfers" bson:"transfers"`
}

type InputPricesCalendar Uses

type InputPricesCalendar struct {
    Origin       string
    Destination  string
    DepartDate   string
    ReturnDate   string
    CalendarType string
    TripDuration int
    Currency     string
}

type InputPricesCheap Uses

type InputPricesCheap struct {
    Origin      string
    Destination string
    DepartDate  string
    ReturnDate  string
    Currency    string
}

type InputPricesLatest Uses

type InputPricesLatest struct {
    Currency          string
    Origin            string
    Destination       string
    BeginningOfPeriod string
    PeriodType        string
    OneWay            bool
    Page              int
    Limit             int
    ShowToAffiliates  bool
    Sorting           string
    TripClass         int
    TripDuration      string
}

type InputPricesMonthMatrix Uses

type InputPricesMonthMatrix struct {
    Currency         string
    Origin           string
    Destination      string
    ShowToAffiliates bool
    Month            string
}

type InputPricesNearestPlacesMatrix Uses

type InputPricesNearestPlacesMatrix struct {
    Currency         string
    Origin           string
    Destination      string
    ShowToAffiliates bool
    DepartDate       string
    ReturnDate       string
}

type InputPricesWeekMatrix Uses

type InputPricesWeekMatrix struct {
    Currency         string
    Origin           string
    Destination      string
    ShowToAffiliates bool
    DepartDate       string
    ReturnDate       string
}

type LoggerInterface Uses

type LoggerInterface interface {
    Debug(...interface{})
}

type Plane Uses

type Plane struct {
    Code string `json:"code" bson:"code"`
    Name string `json:"name" bson:"name"`
}

type Price Uses

type Price struct {
    Actual           bool   `json:"actual" bson:"actual"`
    DepartDate       string `json:"depart_date" bson:"depart_date"`
    Destination      string `json:"destination" bson:"destination"`
    Distance         int    `json:"distance" bson:"distance"`
    FoundAt          string `json:"found_at" bson:"found_at"`
    NumberOfChanges  int    `json:"number_of_changes" bson:"number_of_changes"`
    Origin           string `json:"origin" bson:"origin"`
    ReturnDate       string `json:"return_date" bson:"return_date"`
    ShowToAffiliates bool   `json:"show_to_affiliates" bson:"show_to_affiliates"`
    TripClass        int    `json:"trip_class" bson:"trip_class"`
    Value            int    `json:"value" bson:"value"`
}

type PriceNearest Uses

type PriceNearest struct {
    Origins      []string `json:"origins" bson:"origins"`
    Destinations []string `json:"destinations" bson:"destinations"`
    Prices       []Price  `json:"prices" bson:"prices"`
}

type Route Uses

type Route struct {
    AirlineIata          string   `json:"airline_iata" bson:"airline_iata"`
    AirlineIcao          string   `json:"airline_icao" bson:"airline_icao"`
    DepartureAirportIata string   `json:"departure_airport_iata" bson:"departure_airport_iata"`
    DepartureAirportIcao string   `json:"departure_airport_icao" bson:"departure_airport_icao"`
    ArrivalAirportIata   string   `json:"arrival_airport_iata" bson:"arrival_airport_iata"`
    ArrivalAirportIcao   string   `json:"arrival_airport_icao" bson:"arrival_airport_icao"`
    Codeshare            bool     `json:"codeshare" bson:"codeshare"`
    Transfers            int      `json:"transfers" bson:"transfers"`
    Planes               []string `json:"planes" bson:"planes"`
}

type SpecialOffer Uses

type SpecialOffer struct {
    Airline         string              `xml:"airline,attr" json:"airline" bson:"airline"`
    AirlineCode     string              `xml:"airline_code,attr" json:"airline_code" bson:"airline_code"`
    Title           string              `xml:"title,attr" json:"title" bson:"title"`
    Id              int                 `xml:"id,attr" json:"id" bson:"id"`
    Href            string              `xml:"href,attr" json:"href" bson:"href"`
    SaleDateBegin   int                 `xml:"sale_date_begin,attr" json:"sale_date_begin" bson:"sale_date_begin"`
    SaleDateEnd     int                 `xml:"sale_date_end,attr" json:"sale_date_end" bson:"sale_date_end"`
    FlightDateBegin int                 `xml:"flight_date_begin,attr" json:"flight_date_begin" bson:"flight_date_begin"`
    FlightDateEnd   int                 `xml:"flight_date_end,attr" json:"flight_date_end" bson:"flight_date_end"`
    Link            string              `xml:"link,attr" json:"link" bson:"link"`
    Description     string              `xml:"description" json:"description" bson:"description"`
    Conditions      string              `xml:"conditions" json:"conditions" bson:"conditions"`
    Routes          []SpecialOfferRoute `xml:"route" json:"routes" bson:"routes"`
}

type SpecialOfferRoute Uses

type SpecialOfferRoute struct {
    FromIata       string `xml:"from_iata,attr" json:"from_iata" bson:"from_iata"`
    ToIata         string `xml:"to_iata,attr" json:"to_iata" bson:"to_iata"`
    FromName       string `xml:"from_name,attr" json:"from_name" bson:"from_name"`
    ToName         string `xml:"to_name,attr" json:"to_name" bson:"to_name"`
    Class          string `xml:"class,attr" json:"class" bson:"class"`
    OnewayPrice    string `xml:"oneway_price,attr" json:"oneway_price" bson:"oneway_price"`
    RoundtripPrice string `xml:"roundtrip_price,attr" json:"roundtrip_price" bson:"roundtrip_price"`
}

type XMLSpecialOffers Uses

type XMLSpecialOffers struct {
    XMLName xml.Name       `xml:"offers"`
    Offers  []SpecialOffer `xml:"offer"`
}

Package aviasales imports 6 packages (graph). Updated 2017-04-16. Refresh now. Tools for package owners.