domain

package
v0.0.0-...-88fd450 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Airport

type Airport struct {
	Name     string
	IataCode string
	Country  string
	Region   string
}

Airport includes details of each airport.

func AirportMapFilter

func AirportMapFilter(airports map[string]Airport, f func(Airport) bool) []Airport

AirportMapFilter filters a map of airports, returning an array of values that pass the filter function.

func AirportMapValues

func AirportMapValues(airports map[string]Airport) []Airport

AirportMapValues returns all values of a map of airports.

type Arguments

type Arguments struct {
	Origin          string // IATA airport code
	Destination     string // IATA airport code
	Adults          int    // adults are over 16
	Children        int    // children are 1-16
	Infants         int    // infants are 0-12 months
	OutboundDate    string // must be YYYY-MM-DD
	HolidayDuration int    // in nights
	APIHost         string // from your rapidapi account
	APIKey          string // from your rapidapi account
}

Arguments encapsulates all quote criteria and supporting info needed.

type Direction

type Direction int

Direction indicate which journey type.

const (
	// Outbound indicates an outbound journey
	Outbound Direction = iota

	// Inbound indicates an inbound journey
	Inbound
)

type Flight

type Flight struct {
	ID                 string
	FlightNumber       *FlightNumber
	StartAirport       *Airport
	StartTime          time.Time
	DestinationAirport *Airport
	DestinationTime    time.Time
	Duration           time.Duration
}

Flight details a single leg within a journey.

type FlightNumber

type FlightNumber struct {
	FlightNumber string
	CarrierName  string
	CarrierCode  string
}

FlightNumber details the carrier number for a flight (can be several).

type Itinerary

type Itinerary struct {
	SupplierName    string
	SupplierType    string
	Amount          int // monetary type??
	OutboundJourney *Journey
	InboundJourney  *Journey
}

Itinerary details a holiday travel quote for outbound and inbound journeys.

type Journey

type Journey struct {
	ID        string
	Direction Direction
	Flights   []*Flight
	Duration  time.Duration
	StartTime time.Time
	EndTime   time.Time
}

Journey details an outbound or inbound set of flights within an Itinery.

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
}

Logger handles writing to a log.

type Quote

type Quote struct {
	Itineraries []*Itinerary
	Complete    bool
}

Quote details several itineraries

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳