opensky

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package opensky provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

View Source
const ServerURL = "https://opensky-network.org/api"

ServerURL is the base URL of the opensky API. Pass it to NewClient or NewClientWithResponses.

Variables

This section is empty.

Functions

func NewGetFlightsAllRequest

func NewGetFlightsAllRequest(server string, params *GetFlightsAllParams) (*http.Request, error)

NewGetFlightsAllRequest constructs an http.Request for the GetFlightsAll method

func NewGetFlightsByAircraftRequest

func NewGetFlightsByAircraftRequest(server string, params *GetFlightsByAircraftParams) (*http.Request, error)

NewGetFlightsByAircraftRequest constructs an http.Request for the GetFlightsByAircraft method

func NewGetFlightsByArrivalAirportRequest

func NewGetFlightsByArrivalAirportRequest(server string, params *GetFlightsByArrivalAirportParams) (*http.Request, error)

NewGetFlightsByArrivalAirportRequest constructs an http.Request for the GetFlightsByArrivalAirport method

func NewGetFlightsByDepartureAirportRequest

func NewGetFlightsByDepartureAirportRequest(server string, params *GetFlightsByDepartureAirportParams) (*http.Request, error)

NewGetFlightsByDepartureAirportRequest constructs an http.Request for the GetFlightsByDepartureAirport method

func NewGetOwnStateVectorsRequest

func NewGetOwnStateVectorsRequest(server string, params *GetOwnStateVectorsParams) (*http.Request, error)

NewGetOwnStateVectorsRequest constructs an http.Request for the GetOwnStateVectors method

func NewGetStateVectorsAllRequest

func NewGetStateVectorsAllRequest(server string, params *GetStateVectorsAllParams) (*http.Request, error)

NewGetStateVectorsAllRequest constructs an http.Request for the GetStateVectorsAll method

func NewGetTrackByAircraftRequest

func NewGetTrackByAircraftRequest(server string, params *GetTrackByAircraftParams) (*http.Request, error)

NewGetTrackByAircraftRequest constructs an http.Request for the GetTrackByAircraft method

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetFlightsAll

func (c *Client) GetFlightsAll(ctx context.Context, params *GetFlightsAllParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetFlightsAll Get flights in time interval

Retrieve flights for a given time interval. The time interval must not exceed 2 hours. Returns all flights that were seen within the time interval.

Corresponds with GET /flights/all (the `GetFlightsAll` operationId).

func (*Client) GetFlightsByAircraft

func (c *Client) GetFlightsByAircraft(ctx context.Context, params *GetFlightsByAircraftParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetFlightsByAircraft Get flights by aircraft

Retrieve flights for a particular aircraft within a given time interval. The time interval must not exceed 2 days. Returns all flights for the specified aircraft in the given time range.

Corresponds with GET /flights/aircraft (the `GetFlightsByAircraft` operationId).

func (*Client) GetFlightsByArrivalAirport

func (c *Client) GetFlightsByArrivalAirport(ctx context.Context, params *GetFlightsByArrivalAirportParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetFlightsByArrivalAirport Get arrivals by airport

Retrieve flights arriving at a specific airport within a given time interval. The time interval must not exceed 2 days. Returns all flights that arrived at the specified airport in the given time range.

Corresponds with GET /flights/arrival (the `GetFlightsByArrivalAirport` operationId).

func (*Client) GetFlightsByDepartureAirport

func (c *Client) GetFlightsByDepartureAirport(ctx context.Context, params *GetFlightsByDepartureAirportParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetFlightsByDepartureAirport Get departures by airport

Retrieve flights departing from a specific airport within a given time interval. The time interval should cover more than 2 days of UTC boundaries for best results. Returns all flights that departed from the specified airport in the given time range.

Corresponds with GET /flights/departure (the `GetFlightsByDepartureAirport` operationId).

func (*Client) GetOwnStateVectors

func (c *Client) GetOwnStateVectors(ctx context.Context, params *GetOwnStateVectorsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetOwnStateVectors Get own state vectors

Retrieve state vectors for your own sensors. This endpoint requires authentication and is not rate limited for your own receivers. Returns state vectors from sensors you operate.

Corresponds with GET /states/own (the `GetOwnStateVectors` operationId).

func (*Client) GetStateVectorsAll

func (c *Client) GetStateVectorsAll(ctx context.Context, params *GetStateVectorsAllParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetStateVectorsAll Get all state vectors

Retrieve any state vector of the OpenSky Network. Returns state vectors for all aircraft currently tracked. Rate limits apply (see rate limiting documentation). Anonymous users receive 10-second resolution; authenticated users receive 5-second resolution.

Corresponds with GET /states/all (the `GetStateVectorsAll` operationId).

func (*Client) GetTrackByAircraft

func (c *Client) GetTrackByAircraft(ctx context.Context, params *GetTrackByAircraftParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetTrackByAircraft Get track by aircraft

Retrieve the trajectory for a certain aircraft at a given time. The track is a list of waypoints containing position, altitude, and velocity information. Set time to 0 to get the live track.

Corresponds with GET /tracks (the `GetTrackByAircraft` operationId).

type ClientInterface

type ClientInterface interface {

	// GetFlightsByAircraft Get flights by aircraft
	//
	// Retrieve flights for a particular aircraft within a given time interval. The time interval must not exceed 2 days. Returns all flights for the specified aircraft in the given time range.
	//
	// Corresponds with GET /flights/aircraft (the `GetFlightsByAircraft` operationId).
	GetFlightsByAircraft(ctx context.Context, params *GetFlightsByAircraftParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFlightsAll Get flights in time interval
	//
	// Retrieve flights for a given time interval. The time interval must not exceed 2 hours. Returns all flights that were seen within the time interval.
	//
	// Corresponds with GET /flights/all (the `GetFlightsAll` operationId).
	GetFlightsAll(ctx context.Context, params *GetFlightsAllParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFlightsByArrivalAirport Get arrivals by airport
	//
	// Retrieve flights arriving at a specific airport within a given time interval. The time interval must not exceed 2 days. Returns all flights that arrived at the specified airport in the given time range.
	//
	// Corresponds with GET /flights/arrival (the `GetFlightsByArrivalAirport` operationId).
	GetFlightsByArrivalAirport(ctx context.Context, params *GetFlightsByArrivalAirportParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFlightsByDepartureAirport Get departures by airport
	//
	// Retrieve flights departing from a specific airport within a given time interval. The time interval should cover more than 2 days of UTC boundaries for best results. Returns all flights that departed from the specified airport in the given time range.
	//
	// Corresponds with GET /flights/departure (the `GetFlightsByDepartureAirport` operationId).
	GetFlightsByDepartureAirport(ctx context.Context, params *GetFlightsByDepartureAirportParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetStateVectorsAll Get all state vectors
	//
	// Retrieve any state vector of the OpenSky Network. Returns state vectors for all aircraft currently tracked. Rate limits apply (see rate limiting documentation). Anonymous users receive 10-second resolution; authenticated users receive 5-second resolution.
	//
	// Corresponds with GET /states/all (the `GetStateVectorsAll` operationId).
	GetStateVectorsAll(ctx context.Context, params *GetStateVectorsAllParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetOwnStateVectors Get own state vectors
	//
	// Retrieve state vectors for your own sensors. This endpoint requires authentication and is not rate limited for your own receivers. Returns state vectors from sensors you operate.
	//
	// Corresponds with GET /states/own (the `GetOwnStateVectors` operationId).
	GetOwnStateVectors(ctx context.Context, params *GetOwnStateVectorsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetTrackByAircraft Get track by aircraft
	//
	// Retrieve the trajectory for a certain aircraft at a given time. The track is a list of waypoints containing position, altitude, and velocity information. Set time to 0 to get the live track.
	//
	// Corresponds with GET /tracks (the `GetTrackByAircraft` operationId).
	GetTrackByAircraft(ctx context.Context, params *GetTrackByAircraftParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithAuthentication

func WithAuthentication(clientID, clientSecret string) ClientOption

WithAuthentication returns a ClientOption that authenticates each request by setting the Authorization header to "Bearer <token>". It exchanges the given API client credentials for a token, caches it, and fetches a new one shortly before the 30-minute expiry.

https://openskynetwork.github.io/opensky-api/rest.html

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetFlightsAllWithResponse

func (c *ClientWithResponses) GetFlightsAllWithResponse(ctx context.Context, params *GetFlightsAllParams, reqEditors ...RequestEditorFn) (*GetFlightsAllResponse, error)

GetFlightsAllWithResponse Get flights in time interval

Retrieve flights for a given time interval. The time interval must not exceed 2 hours. Returns all flights that were seen within the time interval.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /flights/all (the `GetFlightsAll` operationId).

func (*ClientWithResponses) GetFlightsByAircraftWithResponse

func (c *ClientWithResponses) GetFlightsByAircraftWithResponse(ctx context.Context, params *GetFlightsByAircraftParams, reqEditors ...RequestEditorFn) (*GetFlightsByAircraftResponse, error)

GetFlightsByAircraftWithResponse Get flights by aircraft

Retrieve flights for a particular aircraft within a given time interval. The time interval must not exceed 2 days. Returns all flights for the specified aircraft in the given time range.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /flights/aircraft (the `GetFlightsByAircraft` operationId).

func (*ClientWithResponses) GetFlightsByArrivalAirportWithResponse

func (c *ClientWithResponses) GetFlightsByArrivalAirportWithResponse(ctx context.Context, params *GetFlightsByArrivalAirportParams, reqEditors ...RequestEditorFn) (*GetFlightsByArrivalAirportResponse, error)

GetFlightsByArrivalAirportWithResponse Get arrivals by airport

Retrieve flights arriving at a specific airport within a given time interval. The time interval must not exceed 2 days. Returns all flights that arrived at the specified airport in the given time range.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /flights/arrival (the `GetFlightsByArrivalAirport` operationId).

func (*ClientWithResponses) GetFlightsByDepartureAirportWithResponse

func (c *ClientWithResponses) GetFlightsByDepartureAirportWithResponse(ctx context.Context, params *GetFlightsByDepartureAirportParams, reqEditors ...RequestEditorFn) (*GetFlightsByDepartureAirportResponse, error)

GetFlightsByDepartureAirportWithResponse Get departures by airport

Retrieve flights departing from a specific airport within a given time interval. The time interval should cover more than 2 days of UTC boundaries for best results. Returns all flights that departed from the specified airport in the given time range.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /flights/departure (the `GetFlightsByDepartureAirport` operationId).

func (*ClientWithResponses) GetOwnStateVectorsWithResponse

func (c *ClientWithResponses) GetOwnStateVectorsWithResponse(ctx context.Context, params *GetOwnStateVectorsParams, reqEditors ...RequestEditorFn) (*GetOwnStateVectorsResponse, error)

GetOwnStateVectorsWithResponse Get own state vectors

Retrieve state vectors for your own sensors. This endpoint requires authentication and is not rate limited for your own receivers. Returns state vectors from sensors you operate.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /states/own (the `GetOwnStateVectors` operationId).

func (*ClientWithResponses) GetStateVectorsAllWithResponse

func (c *ClientWithResponses) GetStateVectorsAllWithResponse(ctx context.Context, params *GetStateVectorsAllParams, reqEditors ...RequestEditorFn) (*GetStateVectorsAllResponse, error)

GetStateVectorsAllWithResponse Get all state vectors

Retrieve any state vector of the OpenSky Network. Returns state vectors for all aircraft currently tracked. Rate limits apply (see rate limiting documentation). Anonymous users receive 10-second resolution; authenticated users receive 5-second resolution.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /states/all (the `GetStateVectorsAll` operationId).

func (*ClientWithResponses) GetTrackByAircraftWithResponse

func (c *ClientWithResponses) GetTrackByAircraftWithResponse(ctx context.Context, params *GetTrackByAircraftParams, reqEditors ...RequestEditorFn) (*GetTrackByAircraftResponse, error)

GetTrackByAircraftWithResponse Get track by aircraft

Retrieve the trajectory for a certain aircraft at a given time. The track is a list of waypoints containing position, altitude, and velocity information. Set time to 0 to get the live track.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /tracks (the `GetTrackByAircraft` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// GetFlightsByAircraftWithResponse Get flights by aircraft
	//
	// Retrieve flights for a particular aircraft within a given time interval. The time interval must not exceed 2 days. Returns all flights for the specified aircraft in the given time range.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /flights/aircraft (the `GetFlightsByAircraft` operationId).
	GetFlightsByAircraftWithResponse(ctx context.Context, params *GetFlightsByAircraftParams, reqEditors ...RequestEditorFn) (*GetFlightsByAircraftResponse, error)

	// GetFlightsAllWithResponse Get flights in time interval
	//
	// Retrieve flights for a given time interval. The time interval must not exceed 2 hours. Returns all flights that were seen within the time interval.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /flights/all (the `GetFlightsAll` operationId).
	GetFlightsAllWithResponse(ctx context.Context, params *GetFlightsAllParams, reqEditors ...RequestEditorFn) (*GetFlightsAllResponse, error)

	// GetFlightsByArrivalAirportWithResponse Get arrivals by airport
	//
	// Retrieve flights arriving at a specific airport within a given time interval. The time interval must not exceed 2 days. Returns all flights that arrived at the specified airport in the given time range.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /flights/arrival (the `GetFlightsByArrivalAirport` operationId).
	GetFlightsByArrivalAirportWithResponse(ctx context.Context, params *GetFlightsByArrivalAirportParams, reqEditors ...RequestEditorFn) (*GetFlightsByArrivalAirportResponse, error)

	// GetFlightsByDepartureAirportWithResponse Get departures by airport
	//
	// Retrieve flights departing from a specific airport within a given time interval. The time interval should cover more than 2 days of UTC boundaries for best results. Returns all flights that departed from the specified airport in the given time range.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /flights/departure (the `GetFlightsByDepartureAirport` operationId).
	GetFlightsByDepartureAirportWithResponse(ctx context.Context, params *GetFlightsByDepartureAirportParams, reqEditors ...RequestEditorFn) (*GetFlightsByDepartureAirportResponse, error)

	// GetStateVectorsAllWithResponse Get all state vectors
	//
	// Retrieve any state vector of the OpenSky Network. Returns state vectors for all aircraft currently tracked. Rate limits apply (see rate limiting documentation). Anonymous users receive 10-second resolution; authenticated users receive 5-second resolution.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /states/all (the `GetStateVectorsAll` operationId).
	GetStateVectorsAllWithResponse(ctx context.Context, params *GetStateVectorsAllParams, reqEditors ...RequestEditorFn) (*GetStateVectorsAllResponse, error)

	// GetOwnStateVectorsWithResponse Get own state vectors
	//
	// Retrieve state vectors for your own sensors. This endpoint requires authentication and is not rate limited for your own receivers. Returns state vectors from sensors you operate.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /states/own (the `GetOwnStateVectors` operationId).
	GetOwnStateVectorsWithResponse(ctx context.Context, params *GetOwnStateVectorsParams, reqEditors ...RequestEditorFn) (*GetOwnStateVectorsResponse, error)

	// GetTrackByAircraftWithResponse Get track by aircraft
	//
	// Retrieve the trajectory for a certain aircraft at a given time. The track is a list of waypoints containing position, altitude, and velocity information. Set time to 0 to get the live track.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /tracks (the `GetTrackByAircraft` operationId).
	GetTrackByAircraftWithResponse(ctx context.Context, params *GetTrackByAircraftParams, reqEditors ...RequestEditorFn) (*GetTrackByAircraftResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Error

type Error struct {
	// Message Human-readable error message.
	Message *string `json:"message,omitempty"`
}

Error defines model for Error.

type FlightObject

type FlightObject struct {
	// ArrivalAirportCandidatesCount Number of other possible arrival airports in short distance to estArrivalAirport.
	ArrivalAirportCandidatesCount *int `json:"arrivalAirportCandidatesCount,omitempty"`

	// Callsign Callsign of the vehicle (8 chars). Can be null if no callsign has been received. If the vehicle transmits multiple callsigns during the flight, the one seen most frequently is used.
	Callsign *string `json:"callsign,omitempty"`

	// DepartureAirportCandidatesCount Number of other possible departure airports in short distance to estDepartureAirport.
	DepartureAirportCandidatesCount *int `json:"departureAirportCandidatesCount,omitempty"`

	// EstArrivalAirport ICAO code of the estimated arrival airport. Can be null if the airport could not be identified.
	EstArrivalAirport *string `json:"estArrivalAirport,omitempty"`

	// EstArrivalAirportHorizDistance Horizontal distance of the last received airborne position to the estimated arrival airport in meters.
	EstArrivalAirportHorizDistance *int `json:"estArrivalAirportHorizDistance,omitempty"`

	// EstArrivalAirportVertDistance Vertical distance of the last received airborne position to the estimated arrival airport in meters.
	EstArrivalAirportVertDistance *int `json:"estArrivalAirportVertDistance,omitempty"`

	// EstDepartureAirport ICAO code of the estimated departure airport. Can be null if the airport could not be identified.
	EstDepartureAirport *string `json:"estDepartureAirport,omitempty"`

	// EstDepartureAirportHorizDistance Horizontal distance of the last received airborne position to the estimated departure airport in meters.
	EstDepartureAirportHorizDistance *int `json:"estDepartureAirportHorizDistance,omitempty"`

	// EstDepartureAirportVertDistance Vertical distance of the last received airborne position to the estimated departure airport in meters.
	EstDepartureAirportVertDistance *int `json:"estDepartureAirportVertDistance,omitempty"`

	// FirstSeen Estimated time of departure for the flight as Unix time (seconds since epoch).
	FirstSeen *int `json:"firstSeen,omitempty"`

	// Icao24 Unique ICAO 24-bit address of the transponder in hex string representation. All letters are lower case.
	Icao24 *string `json:"icao24,omitempty"`

	// LastSeen Estimated time of arrival for the flight as Unix time (seconds since epoch).
	LastSeen *int `json:"lastSeen,omitempty"`
}

FlightObject A flight record representing a single flight detected by the OpenSky Network.

type GetFlightsAllParams

type GetFlightsAllParams struct {
	// Begin Start of time interval to retrieve flights for as Unix time (seconds since epoch).
	Begin int `form:"begin" json:"begin"`

	// End End of time interval to retrieve flights for as Unix time (seconds since epoch). Must be within 2 hours of begin.
	End int `form:"end" json:"end"`
}

GetFlightsAllParams defines parameters for GetFlightsAll.

type GetFlightsAllResponse

type GetFlightsAllResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]FlightObject
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *Error
	// Headers429 the parsed response headers for an HTTP 429 response
	Headers429 *GetFlightsAllResponse429Headers
}

func ParseGetFlightsAllResponse

func ParseGetFlightsAllResponse(rsp *http.Response) (*GetFlightsAllResponse, error)

ParseGetFlightsAllResponse parses an HTTP response from a GetFlightsAllWithResponse call

func (GetFlightsAllResponse) ContentType

func (r GetFlightsAllResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetFlightsAllResponse) GetBody

func (r GetFlightsAllResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetFlightsAllResponse) GetJSON200

func (r GetFlightsAllResponse) GetJSON200() *[]FlightObject

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetFlightsAllResponse) GetJSON400

func (r GetFlightsAllResponse) GetJSON400() *Error

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetFlightsAllResponse) Status

func (r GetFlightsAllResponse) Status() string

Status returns HTTPResponse.Status

func (GetFlightsAllResponse) StatusCode

func (r GetFlightsAllResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFlightsAllResponse429Headers

type GetFlightsAllResponse429Headers struct {
	XRateLimitRetryAfterSeconds *int
}

GetFlightsAllResponse429Headers the declared response headers of an HTTP 429 response for GetFlightsAll

type GetFlightsByAircraftParams

type GetFlightsByAircraftParams struct {
	// Icao24 Unique ICAO 24-bit address of the transponder in lower-case hex string representation (e.g. 3c6444).
	Icao24 string `form:"icao24" json:"icao24"`

	// Begin Start of time interval to retrieve flights for as Unix time (seconds since epoch).
	Begin int `form:"begin" json:"begin"`

	// End End of time interval to retrieve flights for as Unix time (seconds since epoch). Must be within 2 days of begin.
	End int `form:"end" json:"end"`
}

GetFlightsByAircraftParams defines parameters for GetFlightsByAircraft.

type GetFlightsByAircraftResponse

type GetFlightsByAircraftResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]FlightObject
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *Error
	// Headers429 the parsed response headers for an HTTP 429 response
	Headers429 *GetFlightsByAircraftResponse429Headers
}

func ParseGetFlightsByAircraftResponse

func ParseGetFlightsByAircraftResponse(rsp *http.Response) (*GetFlightsByAircraftResponse, error)

ParseGetFlightsByAircraftResponse parses an HTTP response from a GetFlightsByAircraftWithResponse call

func (GetFlightsByAircraftResponse) ContentType

func (r GetFlightsByAircraftResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetFlightsByAircraftResponse) GetBody

func (r GetFlightsByAircraftResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetFlightsByAircraftResponse) GetJSON200

func (r GetFlightsByAircraftResponse) GetJSON200() *[]FlightObject

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetFlightsByAircraftResponse) GetJSON400

func (r GetFlightsByAircraftResponse) GetJSON400() *Error

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetFlightsByAircraftResponse) Status

Status returns HTTPResponse.Status

func (GetFlightsByAircraftResponse) StatusCode

func (r GetFlightsByAircraftResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFlightsByAircraftResponse429Headers

type GetFlightsByAircraftResponse429Headers struct {
	XRateLimitRetryAfterSeconds *int
}

GetFlightsByAircraftResponse429Headers the declared response headers of an HTTP 429 response for GetFlightsByAircraft

type GetFlightsByArrivalAirportParams

type GetFlightsByArrivalAirportParams struct {
	// Airport ICAO identifier for the airport (e.g. EDDF for Frankfurt Airport).
	Airport string `form:"airport" json:"airport"`

	// Begin Start of time interval to retrieve flights for as Unix time (seconds since epoch).
	Begin int `form:"begin" json:"begin"`

	// End End of time interval to retrieve flights for as Unix time (seconds since epoch). Must be within 2 days of begin.
	End int `form:"end" json:"end"`
}

GetFlightsByArrivalAirportParams defines parameters for GetFlightsByArrivalAirport.

type GetFlightsByArrivalAirportResponse

type GetFlightsByArrivalAirportResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]FlightObject
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *Error
	// Headers429 the parsed response headers for an HTTP 429 response
	Headers429 *GetFlightsByArrivalAirportResponse429Headers
}

func ParseGetFlightsByArrivalAirportResponse

func ParseGetFlightsByArrivalAirportResponse(rsp *http.Response) (*GetFlightsByArrivalAirportResponse, error)

ParseGetFlightsByArrivalAirportResponse parses an HTTP response from a GetFlightsByArrivalAirportWithResponse call

func (GetFlightsByArrivalAirportResponse) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetFlightsByArrivalAirportResponse) GetBody

GetBody returns the raw response body bytes

func (GetFlightsByArrivalAirportResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetFlightsByArrivalAirportResponse) GetJSON400

func (r GetFlightsByArrivalAirportResponse) GetJSON400() *Error

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetFlightsByArrivalAirportResponse) Status

Status returns HTTPResponse.Status

func (GetFlightsByArrivalAirportResponse) StatusCode

func (r GetFlightsByArrivalAirportResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFlightsByArrivalAirportResponse429Headers

type GetFlightsByArrivalAirportResponse429Headers struct {
	XRateLimitRetryAfterSeconds *int
}

GetFlightsByArrivalAirportResponse429Headers the declared response headers of an HTTP 429 response for GetFlightsByArrivalAirport

type GetFlightsByDepartureAirportParams

type GetFlightsByDepartureAirportParams struct {
	// Airport ICAO identifier for the airport (typically uppercase, e.g. EDDF for Frankfurt Airport).
	Airport string `form:"airport" json:"airport"`

	// Begin Start of time interval to retrieve flights for as Unix time (seconds since epoch).
	Begin int `form:"begin" json:"begin"`

	// End End of time interval to retrieve flights for as Unix time (seconds since epoch).
	End int `form:"end" json:"end"`
}

GetFlightsByDepartureAirportParams defines parameters for GetFlightsByDepartureAirport.

type GetFlightsByDepartureAirportResponse

type GetFlightsByDepartureAirportResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]FlightObject
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *Error
	// Headers429 the parsed response headers for an HTTP 429 response
	Headers429 *GetFlightsByDepartureAirportResponse429Headers
}

func ParseGetFlightsByDepartureAirportResponse

func ParseGetFlightsByDepartureAirportResponse(rsp *http.Response) (*GetFlightsByDepartureAirportResponse, error)

ParseGetFlightsByDepartureAirportResponse parses an HTTP response from a GetFlightsByDepartureAirportWithResponse call

func (GetFlightsByDepartureAirportResponse) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetFlightsByDepartureAirportResponse) GetBody

GetBody returns the raw response body bytes

func (GetFlightsByDepartureAirportResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetFlightsByDepartureAirportResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetFlightsByDepartureAirportResponse) Status

Status returns HTTPResponse.Status

func (GetFlightsByDepartureAirportResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetFlightsByDepartureAirportResponse429Headers

type GetFlightsByDepartureAirportResponse429Headers struct {
	XRateLimitRetryAfterSeconds *int
}

GetFlightsByDepartureAirportResponse429Headers the declared response headers of an HTTP 429 response for GetFlightsByDepartureAirport

type GetOwnStateVectorsParams

type GetOwnStateVectorsParams struct {
	// Time The time in seconds since epoch (Unix timestamp) to retrieve state vectors for. Current time is used if omitted.
	Time *int `form:"time,omitempty" json:"time,omitempty"`

	// Icao24 One or more ICAO24 transponder addresses represented by a hex string. To filter multiple aircraft, repeat this parameter.
	Icao24 *[]string `form:"icao24,omitempty" json:"icao24,omitempty"`

	// Serials Receiver serial numbers to filter results. To filter for multiple receivers, repeat this parameter.
	Serials *[]int `form:"serials,omitempty" json:"serials,omitempty"`
}

GetOwnStateVectorsParams defines parameters for GetOwnStateVectors.

type GetOwnStateVectorsResponse

type GetOwnStateVectorsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *StateVectorResponse
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *Error
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *Error
}

func ParseGetOwnStateVectorsResponse

func ParseGetOwnStateVectorsResponse(rsp *http.Response) (*GetOwnStateVectorsResponse, error)

ParseGetOwnStateVectorsResponse parses an HTTP response from a GetOwnStateVectorsWithResponse call

func (GetOwnStateVectorsResponse) ContentType

func (r GetOwnStateVectorsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetOwnStateVectorsResponse) GetBody

func (r GetOwnStateVectorsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetOwnStateVectorsResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetOwnStateVectorsResponse) GetJSON401

func (r GetOwnStateVectorsResponse) GetJSON401() *Error

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetOwnStateVectorsResponse) GetJSON403

func (r GetOwnStateVectorsResponse) GetJSON403() *Error

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (GetOwnStateVectorsResponse) Status

Status returns HTTPResponse.Status

func (GetOwnStateVectorsResponse) StatusCode

func (r GetOwnStateVectorsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetStateVectorsAllParams

type GetStateVectorsAllParams struct {
	// Time The time in seconds since epoch (Unix timestamp) to retrieve state vectors for. Current time is used if omitted.
	Time *int `form:"time,omitempty" json:"time,omitempty"`

	// Icao24 One or more ICAO24 transponder addresses represented by a hex string (e.g. abc9f3). To filter multiple aircraft, repeat this parameter.
	Icao24 *[]string `form:"icao24,omitempty" json:"icao24,omitempty"`

	// Lamin Lower bound for the latitude in decimal degrees of the bounding box.
	Lamin *float32 `form:"lamin,omitempty" json:"lamin,omitempty"`

	// Lomin Lower bound for the longitude in decimal degrees of the bounding box.
	Lomin *float32 `form:"lomin,omitempty" json:"lomin,omitempty"`

	// Lamax Upper bound for the latitude in decimal degrees of the bounding box.
	Lamax *float32 `form:"lamax,omitempty" json:"lamax,omitempty"`

	// Lomax Upper bound for the longitude in decimal degrees of the bounding box.
	Lomax *float32 `form:"lomax,omitempty" json:"lomax,omitempty"`

	// Extended Set to 1 to request the extended state vector format which includes aircraft category (index 17).
	Extended *GetStateVectorsAllParamsExtended `form:"extended,omitempty" json:"extended,omitempty"`
}

GetStateVectorsAllParams defines parameters for GetStateVectorsAll.

type GetStateVectorsAllParamsExtended

type GetStateVectorsAllParamsExtended int

GetStateVectorsAllParamsExtended defines parameters for GetStateVectorsAll.

Defines values for GetStateVectorsAllParamsExtended.

func (GetStateVectorsAllParamsExtended) Valid

Valid indicates whether the value is a known member of the GetStateVectorsAllParamsExtended enum.

type GetStateVectorsAllResponse

type GetStateVectorsAllResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *StateVectorResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *Error
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *Error
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *Error
	// Headers429 the parsed response headers for an HTTP 429 response
	Headers429 *GetStateVectorsAllResponse429Headers
}

func ParseGetStateVectorsAllResponse

func ParseGetStateVectorsAllResponse(rsp *http.Response) (*GetStateVectorsAllResponse, error)

ParseGetStateVectorsAllResponse parses an HTTP response from a GetStateVectorsAllWithResponse call

func (GetStateVectorsAllResponse) ContentType

func (r GetStateVectorsAllResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetStateVectorsAllResponse) GetBody

func (r GetStateVectorsAllResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetStateVectorsAllResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetStateVectorsAllResponse) GetJSON400

func (r GetStateVectorsAllResponse) GetJSON400() *Error

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetStateVectorsAllResponse) GetJSON401

func (r GetStateVectorsAllResponse) GetJSON401() *Error

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetStateVectorsAllResponse) GetJSON429

func (r GetStateVectorsAllResponse) GetJSON429() *Error

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (GetStateVectorsAllResponse) Status

Status returns HTTPResponse.Status

func (GetStateVectorsAllResponse) StatusCode

func (r GetStateVectorsAllResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetStateVectorsAllResponse429Headers

type GetStateVectorsAllResponse429Headers struct {
	XRateLimitRetryAfterSeconds *int
}

GetStateVectorsAllResponse429Headers the declared response headers of an HTTP 429 response for GetStateVectorsAll

type GetTrackByAircraftParams

type GetTrackByAircraftParams struct {
	// Icao24 Unique ICAO 24-bit address of the transponder in lower-case hex string representation (e.g. 3c6444).
	Icao24 string `form:"icao24" json:"icao24"`

	// Time Unix timestamp within the time window of the flight to retrieve. Set to 0 for the live track of the aircraft.
	Time *int `form:"time,omitempty" json:"time,omitempty"`
}

GetTrackByAircraftParams defines parameters for GetTrackByAircraft.

type GetTrackByAircraftResponse

type GetTrackByAircraftResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *TrackResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *Error
	// Headers429 the parsed response headers for an HTTP 429 response
	Headers429 *GetTrackByAircraftResponse429Headers
}

func ParseGetTrackByAircraftResponse

func ParseGetTrackByAircraftResponse(rsp *http.Response) (*GetTrackByAircraftResponse, error)

ParseGetTrackByAircraftResponse parses an HTTP response from a GetTrackByAircraftWithResponse call

func (GetTrackByAircraftResponse) ContentType

func (r GetTrackByAircraftResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetTrackByAircraftResponse) GetBody

func (r GetTrackByAircraftResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetTrackByAircraftResponse) GetJSON200

func (r GetTrackByAircraftResponse) GetJSON200() *TrackResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetTrackByAircraftResponse) GetJSON400

func (r GetTrackByAircraftResponse) GetJSON400() *Error

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetTrackByAircraftResponse) Status

Status returns HTTPResponse.Status

func (GetTrackByAircraftResponse) StatusCode

func (r GetTrackByAircraftResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetTrackByAircraftResponse429Headers

type GetTrackByAircraftResponse429Headers struct {
	XRateLimitRetryAfterSeconds *int
}

GetTrackByAircraftResponse429Headers the declared response headers of an HTTP 429 response for GetTrackByAircraft

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type StateVectorResponse

type StateVectorResponse struct {
	// States The state vectors as a two-dimensional array. Each row represents a state vector with 18 indexed fields.
	States *[][]interface{} `json:"states,omitempty"`

	// Time The time which the state vectors in this response are associated with. All vectors represent the state of a vehicle with the interval [time-1, time].
	Time *int `json:"time,omitempty"`
}

StateVectorResponse Response containing a collection of state vectors representing the current state of aircraft.

type TrackResponse

type TrackResponse struct {
	// Callsign Callsign of the aircraft. Can be null.
	Callsign *string `json:"callsign,omitempty"`

	// EndTime Time of the last waypoint in Unix time (seconds since epoch).
	EndTime *int `json:"endTime,omitempty"`

	// Icao24 Unique ICAO 24-bit address of the transponder in hex string representation.
	Icao24 *string `json:"icao24,omitempty"`

	// Path Array of waypoints. Each waypoint is an array with 6 fields: [time, latitude, longitude, baro_altitude, true_track, on_ground].
	Path *[][]interface{} `json:"path,omitempty"`

	// StartTime Time of the first waypoint in Unix time (seconds since epoch).
	StartTime *int `json:"startTime,omitempty"`
}

TrackResponse A track representing the path of an aircraft over time.

Jump to

Keyboard shortcuts

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