client

package
v0.0.0-...-630d023 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2017 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new Southwest API client. If a nil httpClient is provided, http.DefaultClient will be used.

func (*Client) ListFlights

func (c *Client) ListFlights(departureDate time.Time, originAirport string, destinationAirport string) ([]*model.Flight, error)

func (*Client) SearchFlights

func (c *Client) SearchFlights(
	originAirports []string,
	destinationAirports []string,
	minLocalDepartureTime time.Time,
	maxLocalArrivalTime time.Time,
	filters []FlightFilter) ([]*model.Flight, error)

type FlightFilter

type FlightFilter interface {
	Matches(*model.Flight) bool
}

type MaxAvailableFareFilter

type MaxAvailableFareFilter struct {
	Cents uint32
}

func (*MaxAvailableFareFilter) Matches

func (m *MaxAvailableFareFilter) Matches(flight *model.Flight) bool

type MaxStopsFilter

type MaxStopsFilter struct {
	Stops int
}

func (*MaxStopsFilter) Matches

func (m *MaxStopsFilter) Matches(flight *model.Flight) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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