client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateLocationFromIP

func CalculateLocationFromIP() (*model.Location, error)

CalculateLocationFromIP get geo location data by using public ip

func CreateGetRequest

func CreateGetRequest(params url.Values, airportDbUrl string) (*http.Request, error)

CreateGetRequest creates an AirportDB GET request

func GetAirPortDbSearchUri

func GetAirPortDbSearchUri(airportDbUrl string) string

GetAirPortDbSearchUri gat airport db search url, use a default one if does not exist

func GetHttpClient

func GetHttpClient() *http.Client

GetHttpClient create HTTP client instance for Airport DB

func ListAirportsByDistance

func ListAirportsByDistance(client Client, location model.Location, rows int, airportSearchUrl string) ([]model.Airport, error)

ListAirportsByDistance list airports based geo location distance

Types

type AirportClient added in v0.3.0

type AirportClient struct {
}

AirportClient type that implements Client interface

func (*AirportClient) ProcessRequest added in v0.3.0

func (a *AirportClient) ProcessRequest(request *http.Request) ([]byte, error)

ProcessRequest get a simple response from a REST call

type Client added in v0.3.0

type Client interface {
	ProcessRequest(*http.Request) ([]byte, error)
}

Client interface that holds http operations for communicationg with airport db

Jump to

Keyboard shortcuts

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