openflights: go.pedge.io/openflights Index | Files | Directories

package openflights

import "go.pedge.io/openflights"

Package openflights exposes various flight data from OpenFlights.org.

If you do use this package, I ask you to donate to OpenFlights, the source for all the data in here as of now, at http://openflights.org/donate. Seriously, if you can afford it, the OpenFlights team is responsible for putting all this data together and maintaining it, and we owe it to them to support their work.

Index

Package Files

api_server.go client.go code_store.go csv_store.go filters.go generated.go id_store.go local_api_client.go openflights.go openflights.pb.go openflights.pb.gw.go server_client.go util.go

Variables

var DST_name = map[int32]string{
    0:  "DST_NONE",
    1:  "DST_A",
    2:  "DST_E",
    3:  "DST_N",
    4:  "DST_O",
    5:  "DST_S",
    6:  "DST_U",
    7:  "DST_Z",
}
var DST_value = map[string]int32{
    "DST_NONE": 0,
    "DST_A":    1,
    "DST_E":    2,
    "DST_N":    3,
    "DST_O":    4,
    "DST_S":    5,
    "DST_U":    6,
    "DST_Z":    7,
}

func PrettyPrintGetMilesResponse Uses

func PrettyPrintGetMilesResponse(w io.Writer, response *GetMilesResponse) error

PrettyPrintGetMilesResponse prints a GetMilesResponse in readable format.

func RegisterAPIHandler Uses

func RegisterAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterAPIHandler registers the http handlers for service API to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterAPIHandlerFromEndpoint Uses

func RegisterAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAPIHandlerFromEndpoint is same as RegisterAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAPIServer Uses

func RegisterAPIServer(s *grpc.Server, srv APIServer)

type APIClient Uses

type APIClient interface {
    GetAllAirports(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (API_GetAllAirportsClient, error)
    GetAllAirlines(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (API_GetAllAirlinesClient, error)
    GetAllRoutes(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (API_GetAllRoutesClient, error)
    GetAirport(ctx context.Context, in *GetAirportRequest, opts ...grpc.CallOption) (*Airport, error)
    GetAirline(ctx context.Context, in *GetAirlineRequest, opts ...grpc.CallOption) (*Airline, error)
    GetRoutes(ctx context.Context, in *GetRoutesRequest, opts ...grpc.CallOption) (*Routes, error)
    GetDistance(ctx context.Context, in *GetDistanceRequest, opts ...grpc.CallOption) (*google_protobuf2.UInt32Value, error)
    GetMiles(ctx context.Context, in *GetMilesRequest, opts ...grpc.CallOption) (*GetMilesResponse, error)
}

func NewAPIClient Uses

func NewAPIClient(cc *grpc.ClientConn) APIClient

func NewLocalAPIClient Uses

func NewLocalAPIClient(apiServer APIServer) APIClient

NewLocalAPIClient creates a new APIClient using the given APIServer.

type APIServer Uses

type APIServer interface {
    GetAllAirports(*google_protobuf1.Empty, API_GetAllAirportsServer) error
    GetAllAirlines(*google_protobuf1.Empty, API_GetAllAirlinesServer) error
    GetAllRoutes(*google_protobuf1.Empty, API_GetAllRoutesServer) error
    GetAirport(context.Context, *GetAirportRequest) (*Airport, error)
    GetAirline(context.Context, *GetAirlineRequest) (*Airline, error)
    GetRoutes(context.Context, *GetRoutesRequest) (*Routes, error)
    GetDistance(context.Context, *GetDistanceRequest) (*google_protobuf2.UInt32Value, error)
    GetMiles(context.Context, *GetMilesRequest) (*GetMilesResponse, error)
}

func NewAPIServer Uses

func NewAPIServer(client Client) APIServer

NewAPIServer creates a new APIServer using the given Client.

type API_GetAllAirlinesClient Uses

type API_GetAllAirlinesClient interface {
    Recv() (*Airline, error)
    grpc.ClientStream
}

type API_GetAllAirlinesServer Uses

type API_GetAllAirlinesServer interface {
    Send(*Airline) error
    grpc.ServerStream
}

type API_GetAllAirportsClient Uses

type API_GetAllAirportsClient interface {
    Recv() (*Airport, error)
    grpc.ClientStream
}

type API_GetAllAirportsServer Uses

type API_GetAllAirportsServer interface {
    Send(*Airport) error
    grpc.ServerStream
}

type API_GetAllRoutesClient Uses

type API_GetAllRoutesClient interface {
    Recv() (*Route, error)
    grpc.ClientStream
}

type API_GetAllRoutesServer Uses

type API_GetAllRoutesServer interface {
    Send(*Route) error
    grpc.ServerStream
}

type Airline Uses

type Airline struct {
    Id       string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
    Name     string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
    Alias    string `protobuf:"bytes,3,opt,name=alias" json:"alias,omitempty"`
    Iata     string `protobuf:"bytes,4,opt,name=iata" json:"iata,omitempty"`
    Icao     string `protobuf:"bytes,5,opt,name=icao" json:"icao,omitempty"`
    Callsign string `protobuf:"bytes,6,opt,name=callsign" json:"callsign,omitempty"`
    Country  string `protobuf:"bytes,7,opt,name=country" json:"country,omitempty"`
    Active   bool   `protobuf:"varint,8,opt,name=active" json:"active,omitempty"`
}

Airline represents an airline.

func (*Airline) Codes Uses

func (airline *Airline) Codes() []string

Codes returns the airline codes.

func (*Airline) Descriptor Uses

func (*Airline) Descriptor() ([]byte, []int)

func (*Airline) GetActive Uses

func (m *Airline) GetActive() bool

func (*Airline) GetAlias Uses

func (m *Airline) GetAlias() string

func (*Airline) GetCallsign Uses

func (m *Airline) GetCallsign() string

func (*Airline) GetCountry Uses

func (m *Airline) GetCountry() string

func (*Airline) GetIata Uses

func (m *Airline) GetIata() string

func (*Airline) GetIcao Uses

func (m *Airline) GetIcao() string

func (*Airline) GetId Uses

func (m *Airline) GetId() string

func (*Airline) GetName Uses

func (m *Airline) GetName() string

func (*Airline) ProtoMessage Uses

func (*Airline) ProtoMessage()

func (*Airline) Reset Uses

func (m *Airline) Reset()

func (*Airline) String Uses

func (m *Airline) String() string

type Airlines Uses

type Airlines struct {
    Airline []*Airline `protobuf:"bytes,1,rep,name=airline" json:"airline,omitempty"`
}

Airlines is the protobuf plural for Airline.

func (*Airlines) Descriptor Uses

func (*Airlines) Descriptor() ([]byte, []int)

func (*Airlines) GetAirline Uses

func (m *Airlines) GetAirline() []*Airline

func (*Airlines) ProtoMessage Uses

func (*Airlines) ProtoMessage()

func (*Airlines) Reset Uses

func (m *Airlines) Reset()

func (*Airlines) String Uses

func (m *Airlines) String() string

type Airport Uses

type Airport struct {
    Id                    string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
    Name                  string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
    City                  string `protobuf:"bytes,3,opt,name=city" json:"city,omitempty"`
    Country               string `protobuf:"bytes,4,opt,name=country" json:"country,omitempty"`
    IataFaa               string `protobuf:"bytes,5,opt,name=iata_faa,json=iataFaa" json:"iata_faa,omitempty"`
    Icao                  string `protobuf:"bytes,6,opt,name=icao" json:"icao,omitempty"`
    LatitudeMicros        int32  `protobuf:"zigzag32,7,opt,name=latitude_micros,json=latitudeMicros" json:"latitude_micros,omitempty"`
    LongitudeMicros       int32  `protobuf:"zigzag32,8,opt,name=longitude_micros,json=longitudeMicros" json:"longitude_micros,omitempty"`
    AltitudeFeet          int32  `protobuf:"varint,9,opt,name=altitude_feet,json=altitudeFeet" json:"altitude_feet,omitempty"`
    TimezoneOffsetMinutes int32  `protobuf:"zigzag32,10,opt,name=timezone_offset_minutes,json=timezoneOffsetMinutes" json:"timezone_offset_minutes,omitempty"`
    Dst                   DST    `protobuf:"varint,11,opt,name=dst,enum=openflights.DST" json:"dst,omitempty"`
    Timezone              string `protobuf:"bytes,12,opt,name=timezone" json:"timezone,omitempty"`
}

Airport represents an airport.

func (*Airport) Codes Uses

func (airport *Airport) Codes() []string

Codes returns the airport codes.

func (*Airport) Descriptor Uses

func (*Airport) Descriptor() ([]byte, []int)

func (*Airport) GetAltitudeFeet Uses

func (m *Airport) GetAltitudeFeet() int32

func (*Airport) GetCity Uses

func (m *Airport) GetCity() string

func (*Airport) GetCountry Uses

func (m *Airport) GetCountry() string

func (*Airport) GetDst Uses

func (m *Airport) GetDst() DST

func (*Airport) GetIataFaa Uses

func (m *Airport) GetIataFaa() string

func (*Airport) GetIcao Uses

func (m *Airport) GetIcao() string

func (*Airport) GetId Uses

func (m *Airport) GetId() string

func (*Airport) GetLatitudeMicros Uses

func (m *Airport) GetLatitudeMicros() int32

func (*Airport) GetLongitudeMicros Uses

func (m *Airport) GetLongitudeMicros() int32

func (*Airport) GetName Uses

func (m *Airport) GetName() string

func (*Airport) GetTimezone Uses

func (m *Airport) GetTimezone() string

func (*Airport) GetTimezoneOffsetMinutes Uses

func (m *Airport) GetTimezoneOffsetMinutes() int32

func (*Airport) ProtoMessage Uses

func (*Airport) ProtoMessage()

func (*Airport) Reset Uses

func (m *Airport) Reset()

func (*Airport) String Uses

func (m *Airport) String() string

type Airports Uses

type Airports struct {
    Airport []*Airport `protobuf:"bytes,1,rep,name=airport" json:"airport,omitempty"`
}

Airports is the protobuf plural for Airport.

func (*Airports) Descriptor Uses

func (*Airports) Descriptor() ([]byte, []int)

func (*Airports) GetAirport Uses

func (m *Airports) GetAirport() []*Airport

func (*Airports) ProtoMessage Uses

func (*Airports) ProtoMessage()

func (*Airports) Reset Uses

func (m *Airports) Reset()

func (*Airports) String Uses

func (m *Airports) String() string

type CSVStore Uses

type CSVStore struct {
    Airports []byte `protobuf:"bytes,1,opt,name=airports,proto3" json:"airports,omitempty"`
    Airlines []byte `protobuf:"bytes,2,opt,name=airlines,proto3" json:"airlines,omitempty"`
    Routes   []byte `protobuf:"bytes,3,opt,name=routes,proto3" json:"routes,omitempty"`
}

CSVStore stores information on flights in CSV format.

func GetCSVStore Uses

func GetCSVStore() (*CSVStore, error)

GetCSVStore gets the CSVStore from GitHub.

func (*CSVStore) Descriptor Uses

func (*CSVStore) Descriptor() ([]byte, []int)

func (*CSVStore) GetAirlines Uses

func (m *CSVStore) GetAirlines() []byte

func (*CSVStore) GetAirports Uses

func (m *CSVStore) GetAirports() []byte

func (*CSVStore) GetRoutes Uses

func (m *CSVStore) GetRoutes() []byte

func (*CSVStore) ProtoMessage Uses

func (*CSVStore) ProtoMessage()

func (*CSVStore) Reset Uses

func (m *CSVStore) Reset()

func (*CSVStore) String Uses

func (m *CSVStore) String() string

type Client Uses

type Client interface {
    IDClient
    CodeClient
    GetAirport(idOrCode string) (*Airport, error)
    GetAirline(idOrCode string) (*Airline, error)
    GetDistance(sourceAirportIDOrCode string, destinationAirportIDOrCode string) (uint32, error)
    GetMiles(*GetMilesRequest) (*GetMilesResponse, error)
}

Client is the client to interface with flights data.

func NewClient Uses

func NewClient(apiClient APIClient) Client

NewClient creates a new Client that calles the given APIClient.

func NewDefaultServerClient Uses

func NewDefaultServerClient() (Client, error)

NewDefaultServerClient creates a new server-side Client from the generated CSVStore.

func NewDefaultServerClientWithOptions Uses

func NewDefaultServerClientWithOptions(options CodeStoreOptions) (Client, error)

NewDefaultServerClientWithOptions creates a new server-side Client from the generated CSVStore with CodeStoreOptions.

func NewServerClient Uses

func NewServerClient(idStore *IDStore, options CodeStoreOptions) (Client, error)

NewServerClient creates a new server-side Client.

type CodeClient Uses

type CodeClient interface {
    GetAirportByCode(code string) (*Airport, error)
    GetAirlineByCode(code string) (*Airline, error)
    GetRoutes(airlineIDOrCode string, sourceAirportIDOrCode string, destinationAirportIDOrCode string) ([]*Route, error)
}

CodeClient is the client to interface with flights data by ICAO/IATA/FAA code.

type CodeStore Uses

type CodeStore struct {
    CodeToAirport              map[string]*Airport
    CodeToAirline              map[string]*Airline
    AirlineToRoutes            map[string][]*Route
    SourceAirportToRoutes      map[string][]*Route
    DestinationAirportToRoutes map[string][]*Route
}

CodeStore is a mapping for airline/airport codes (ICAO or IATA/FAA) to object.

Duplicates may be filtered, ie there may be airlines/airports in a CSVStore or IDStore that are not present in this structure.

func NewCodeStore Uses

func NewCodeStore(idStore *IDStore, options CodeStoreOptions) (*CodeStore, error)

NewCodeStore creates a new CodeStore from an IDStore.

func (*CodeStore) GetAirlineByCode Uses

func (c *CodeStore) GetAirlineByCode(code string) (*Airline, error)

GetAirlineByCode returns the Airline for the given ICAO/IATA/FAA code, or error if it does not exist.

func (*CodeStore) GetAirportByCode Uses

func (c *CodeStore) GetAirportByCode(code string) (*Airport, error)

GetAirportByCode returns the Airport for the given ICAO/IATA/FAA code, or error if it does not exist.

func (*CodeStore) GetRoutes Uses

func (c *CodeStore) GetRoutes(airline string, source string, dest string) ([]*Route, error)

GetRoutes returns the Routes for the given ICAO/IATA/FAA codes or ids.

type CodeStoreOptions Uses

type CodeStoreOptions struct {
    // if set, duplicates will not be filtered
    NoFilterDuplicates bool
    // if set, an error will not be returned on a duplicate
    NoErrorOnDuplicates bool
    // if set, will log warnings during instantiation using this function
    // in the style of log.Printf, otherwise will use the stdlib logger.
    LogFunc func(string, ...interface{})
}

CodeStoreOptions are options for a CodeStore.

type DST Uses

type DST int32

DST represents the DST value for a timezone.

const (
    DST_DST_NONE DST = 0
    DST_DST_A    DST = 1
    DST_DST_E    DST = 2
    DST_DST_N    DST = 3
    DST_DST_O    DST = 4
    DST_DST_S    DST = 5
    DST_DST_U    DST = 6
    DST_DST_Z    DST = 7
)

func (DST) EnumDescriptor Uses

func (DST) EnumDescriptor() ([]byte, []int)

func (DST) String Uses

func (x DST) String() string

type GetAirlineRequest Uses

type GetAirlineRequest struct {
    Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}

func (*GetAirlineRequest) Descriptor Uses

func (*GetAirlineRequest) Descriptor() ([]byte, []int)

func (*GetAirlineRequest) GetId Uses

func (m *GetAirlineRequest) GetId() string

func (*GetAirlineRequest) ProtoMessage Uses

func (*GetAirlineRequest) ProtoMessage()

func (*GetAirlineRequest) Reset Uses

func (m *GetAirlineRequest) Reset()

func (*GetAirlineRequest) String Uses

func (m *GetAirlineRequest) String() string

type GetAirportRequest Uses

type GetAirportRequest struct {
    Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
}

func (*GetAirportRequest) Descriptor Uses

func (*GetAirportRequest) Descriptor() ([]byte, []int)

func (*GetAirportRequest) GetId Uses

func (m *GetAirportRequest) GetId() string

func (*GetAirportRequest) ProtoMessage Uses

func (*GetAirportRequest) ProtoMessage()

func (*GetAirportRequest) Reset Uses

func (m *GetAirportRequest) Reset()

func (*GetAirportRequest) String Uses

func (m *GetAirportRequest) String() string

type GetDistanceRequest Uses

type GetDistanceRequest struct {
    SourceAirportId      string `protobuf:"bytes,1,opt,name=source_airport_id,json=sourceAirportId" json:"source_airport_id,omitempty"`
    DestinationAirportId string `protobuf:"bytes,2,opt,name=destination_airport_id,json=destinationAirportId" json:"destination_airport_id,omitempty"`
}

func (*GetDistanceRequest) Descriptor Uses

func (*GetDistanceRequest) Descriptor() ([]byte, []int)

func (*GetDistanceRequest) GetDestinationAirportId Uses

func (m *GetDistanceRequest) GetDestinationAirportId() string

func (*GetDistanceRequest) GetSourceAirportId Uses

func (m *GetDistanceRequest) GetSourceAirportId() string

func (*GetDistanceRequest) ProtoMessage Uses

func (*GetDistanceRequest) ProtoMessage()

func (*GetDistanceRequest) Reset Uses

func (m *GetDistanceRequest) Reset()

func (*GetDistanceRequest) String Uses

func (m *GetDistanceRequest) String() string

type GetMilesRequest Uses

type GetMilesRequest struct {
    // vie-ord-mem/jfk-vie
    Route    string `protobuf:"bytes,1,opt,name=route" json:"route,omitempty"`
    MinMiles uint32 `protobuf:"varint,2,opt,name=min_miles,json=minMiles" json:"min_miles,omitempty"`
    // 100 = 100%, default = 100%
    Percentage uint32 `protobuf:"varint,3,opt,name=percentage" json:"percentage,omitempty"`
}

func (*GetMilesRequest) Descriptor Uses

func (*GetMilesRequest) Descriptor() ([]byte, []int)

func (*GetMilesRequest) GetMinMiles Uses

func (m *GetMilesRequest) GetMinMiles() uint32

func (*GetMilesRequest) GetPercentage Uses

func (m *GetMilesRequest) GetPercentage() uint32

func (*GetMilesRequest) GetRoute Uses

func (m *GetMilesRequest) GetRoute() string

func (*GetMilesRequest) ProtoMessage Uses

func (*GetMilesRequest) ProtoMessage()

func (*GetMilesRequest) Reset Uses

func (m *GetMilesRequest) Reset()

func (*GetMilesRequest) String Uses

func (m *GetMilesRequest) String() string

type GetMilesResponse Uses

type GetMilesResponse struct {
    Segment          []*GetMilesResponse_Segment `protobuf:"bytes,1,rep,name=segment" json:"segment,omitempty"`
    TotalMiles       uint32                      `protobuf:"varint,2,opt,name=total_miles,json=totalMiles" json:"total_miles,omitempty"`
    TotalActualMiles uint32                      `protobuf:"varint,3,opt,name=total_actual_miles,json=totalActualMiles" json:"total_actual_miles,omitempty"`
}

func (*GetMilesResponse) Descriptor Uses

func (*GetMilesResponse) Descriptor() ([]byte, []int)

func (*GetMilesResponse) GetSegment Uses

func (m *GetMilesResponse) GetSegment() []*GetMilesResponse_Segment

func (*GetMilesResponse) GetTotalActualMiles Uses

func (m *GetMilesResponse) GetTotalActualMiles() uint32

func (*GetMilesResponse) GetTotalMiles Uses

func (m *GetMilesResponse) GetTotalMiles() uint32

func (*GetMilesResponse) ProtoMessage Uses

func (*GetMilesResponse) ProtoMessage()

func (*GetMilesResponse) Reset Uses

func (m *GetMilesResponse) Reset()

func (*GetMilesResponse) String Uses

func (m *GetMilesResponse) String() string

type GetMilesResponse_Segment Uses

type GetMilesResponse_Segment struct {
    SourceAirportId      string `protobuf:"bytes,1,opt,name=source_airport_id,json=sourceAirportId" json:"source_airport_id,omitempty"`
    DestinationAirportId string `protobuf:"bytes,2,opt,name=destination_airport_id,json=destinationAirportId" json:"destination_airport_id,omitempty"`
    Miles                uint32 `protobuf:"varint,3,opt,name=miles" json:"miles,omitempty"`
    ActualMiles          uint32 `protobuf:"varint,4,opt,name=actual_miles,json=actualMiles" json:"actual_miles,omitempty"`
}

func (*GetMilesResponse_Segment) Descriptor Uses

func (*GetMilesResponse_Segment) Descriptor() ([]byte, []int)

func (*GetMilesResponse_Segment) GetActualMiles Uses

func (m *GetMilesResponse_Segment) GetActualMiles() uint32

func (*GetMilesResponse_Segment) GetDestinationAirportId Uses

func (m *GetMilesResponse_Segment) GetDestinationAirportId() string

func (*GetMilesResponse_Segment) GetMiles Uses

func (m *GetMilesResponse_Segment) GetMiles() uint32

func (*GetMilesResponse_Segment) GetSourceAirportId Uses

func (m *GetMilesResponse_Segment) GetSourceAirportId() string

func (*GetMilesResponse_Segment) ProtoMessage Uses

func (*GetMilesResponse_Segment) ProtoMessage()

func (*GetMilesResponse_Segment) Reset Uses

func (m *GetMilesResponse_Segment) Reset()

func (*GetMilesResponse_Segment) String Uses

func (m *GetMilesResponse_Segment) String() string

type GetRoutesRequest Uses

type GetRoutesRequest struct {
    AirlineId            string `protobuf:"bytes,1,opt,name=airline_id,json=airlineId" json:"airline_id,omitempty"`
    SourceAirportId      string `protobuf:"bytes,2,opt,name=source_airport_id,json=sourceAirportId" json:"source_airport_id,omitempty"`
    DestinationAirportId string `protobuf:"bytes,3,opt,name=destination_airport_id,json=destinationAirportId" json:"destination_airport_id,omitempty"`
}

func (*GetRoutesRequest) Descriptor Uses

func (*GetRoutesRequest) Descriptor() ([]byte, []int)

func (*GetRoutesRequest) GetAirlineId Uses

func (m *GetRoutesRequest) GetAirlineId() string

func (*GetRoutesRequest) GetDestinationAirportId Uses

func (m *GetRoutesRequest) GetDestinationAirportId() string

func (*GetRoutesRequest) GetSourceAirportId Uses

func (m *GetRoutesRequest) GetSourceAirportId() string

func (*GetRoutesRequest) ProtoMessage Uses

func (*GetRoutesRequest) ProtoMessage()

func (*GetRoutesRequest) Reset Uses

func (m *GetRoutesRequest) Reset()

func (*GetRoutesRequest) String Uses

func (m *GetRoutesRequest) String() string

type IDClient Uses

type IDClient interface {
    // callbackErr will return nil or an error after out is closed or cancel is called (which in turn closes out)
    GetAllAirports() (out <-chan *Airport, cancel chan<- bool, callbackErr <-chan error, err error)
    // callbackErr will return nil or an error after out is closed or cancel is called (which in turn closes out)
    GetAllAirlines() (out <-chan *Airline, cancel chan<- bool, callbackErr <-chan error, err error)
    // callbackErr will return nil or an error after out is closed or cancel is called (which in turn closes out)
    GetAllRoutes() (out <-chan *Route, cancel chan<- bool, callbackErr <-chan error, err error)
    GetAirportByID(id string) (*Airport, error)
    GetAirlineByID(id string) (*Airline, error)
}

IDClient is the client to interface with flights data by ID.

type IDStore Uses

type IDStore struct {
    IdToAirport map[string]*Airport `protobuf:"bytes,1,rep,name=id_to_airport,json=idToAirport" json:"id_to_airport,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
    IdToAirline map[string]*Airline `protobuf:"bytes,2,rep,name=id_to_airline,json=idToAirline" json:"id_to_airline,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
    Route       []*Route            `protobuf:"bytes,3,rep,name=route" json:"route,omitempty"`
}

IDStore stores maps from id to object.

func NewIDStore Uses

func NewIDStore(csvStore *CSVStore) (*IDStore, error)

NewIDStore creates a new IDStore from a CSVStore.

func (*IDStore) Descriptor Uses

func (*IDStore) Descriptor() ([]byte, []int)

func (*IDStore) GetAirlineByID Uses

func (i *IDStore) GetAirlineByID(id string) (*Airline, error)

GetAirlineByID returns an Airline by ID, or error if it does not exist.

func (*IDStore) GetAirportByID Uses

func (i *IDStore) GetAirportByID(id string) (*Airport, error)

GetAirportByID returns an Airport by ID, or error if it does not exist.

func (*IDStore) GetAllAirlines Uses

func (i *IDStore) GetAllAirlines() (<-chan *Airline, chan<- bool, <-chan error, error)

GetAllAirlines returns all Airlines.

func (*IDStore) GetAllAirports Uses

func (i *IDStore) GetAllAirports() (<-chan *Airport, chan<- bool, <-chan error, error)

GetAllAirports returns all Airports.

func (*IDStore) GetAllRoutes Uses

func (i *IDStore) GetAllRoutes() (<-chan *Route, chan<- bool, <-chan error, error)

GetAllRoutes returns all Routes.

func (*IDStore) GetIdToAirline Uses

func (m *IDStore) GetIdToAirline() map[string]*Airline

func (*IDStore) GetIdToAirport Uses

func (m *IDStore) GetIdToAirport() map[string]*Airport

func (*IDStore) GetRoute Uses

func (m *IDStore) GetRoute() []*Route

func (*IDStore) ProtoMessage Uses

func (*IDStore) ProtoMessage()

func (*IDStore) Reset Uses

func (m *IDStore) Reset()

func (*IDStore) String Uses

func (m *IDStore) String() string

type Route Uses

type Route struct {
    Airline            *Airline `protobuf:"bytes,1,opt,name=airline" json:"airline,omitempty"`
    SourceAirport      *Airport `protobuf:"bytes,2,opt,name=source_airport,json=sourceAirport" json:"source_airport,omitempty"`
    DestinationAirport *Airport `protobuf:"bytes,3,opt,name=destination_airport,json=destinationAirport" json:"destination_airport,omitempty"`
    Codeshare          bool     `protobuf:"varint,4,opt,name=codeshare" json:"codeshare,omitempty"`
    Stops              uint32   `protobuf:"varint,5,opt,name=stops" json:"stops,omitempty"`
}

Route represents a route.

func (*Route) Descriptor Uses

func (*Route) Descriptor() ([]byte, []int)

func (*Route) GetAirline Uses

func (m *Route) GetAirline() *Airline

func (*Route) GetCodeshare Uses

func (m *Route) GetCodeshare() bool

func (*Route) GetDestinationAirport Uses

func (m *Route) GetDestinationAirport() *Airport

func (*Route) GetSourceAirport Uses

func (m *Route) GetSourceAirport() *Airport

func (*Route) GetStops Uses

func (m *Route) GetStops() uint32

func (*Route) ProtoMessage Uses

func (*Route) ProtoMessage()

func (*Route) Reset Uses

func (m *Route) Reset()

func (*Route) String Uses

func (m *Route) String() string

type Routes Uses

type Routes struct {
    Route []*Route `protobuf:"bytes,1,rep,name=route" json:"route,omitempty"`
}

Routes is the protobuf plural for Airport.

func (*Routes) Descriptor Uses

func (*Routes) Descriptor() ([]byte, []int)

func (*Routes) GetRoute Uses

func (m *Routes) GetRoute() []*Route

func (*Routes) ProtoMessage Uses

func (*Routes) ProtoMessage()

func (*Routes) Reset Uses

func (m *Routes) Reset()

func (*Routes) String Uses

func (m *Routes) String() string

Directories

PathSynopsis
daemon

Package openflights imports 22 packages (graph) and is imported by 3 packages. Updated 2017-04-23. Refresh now. Tools for package owners.