data

package
v0.0.0-...-e204074 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSeatMapFreshFetchRequired = errors.New("fresh fetch required but not allowed")

Functions

This section is empty.

Types

type Aircraft

type Aircraft struct {
	Code           string             `json:"code"`
	EquipCode      string             `json:"equipCode"`
	Name           string             `json:"name"`
	Configurations common.Set[string] `json:"configurations"`
}

type Airport

type Airport struct {
	Code string  `json:"code"`
	Name string  `json:"name"`
	Lat  float64 `json:"lat"`
	Lng  float64 `json:"lng"`
}

type AirportsResponse

type AirportsResponse struct {
	Airports          []Airport          `json:"airports"`
	MetropolitanAreas []MetropolitanArea `json:"metropolitanAreas"`
}

type Handler

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

func NewHandler

func NewHandler(s3c MinimalS3Client, lhc *lufthansa.Client, bucket string) *Handler

func (*Handler) Aircraft

func (h *Handler) Aircraft(ctx context.Context) ([]Aircraft, error)

func (*Handler) Airlines

func (h *Handler) Airlines(ctx context.Context, prefix string) ([]common.AirlineIdentifier, error)

func (*Handler) Airports

func (h *Handler) Airports(ctx context.Context) (AirportsResponse, error)

func (*Handler) Flight

func (h *Handler) Flight(ctx context.Context, fn common.FlightNumber, departureDateUTC xtime.LocalDate, departureAirport string, allowCodeShare bool) (*common.Flight, time.Time, error)

func (*Handler) FlightNumbers

func (h *Handler) FlightNumbers(ctx context.Context, prefix string, limit int) ([]common.FlightNumber, error)

func (*Handler) FlightNumbersRaw

func (h *Handler) FlightNumbersRaw(ctx context.Context) (map[common.FlightNumber]time.Time, error)

func (*Handler) FlightSchedule

func (h *Handler) FlightSchedule(ctx context.Context, fn common.FlightNumber) (*common.FlightSchedule, error)

func (*Handler) QuerySchedules

func (h *Handler) QuerySchedules(ctx context.Context, opts ...QueryScheduleOption) (map[common.FlightNumber]*common.FlightSchedule, error)

func (*Handler) SeatMap

func (h *Handler) SeatMap(ctx context.Context, fn common.FlightNumber, departureAirport, arrivalAirport string, departureDate xtime.LocalDate, cabinClass lufthansa.RequestCabinClass, aircraftType, aircraftConfigurationVersion string, allowFetchFresh bool) (*lufthansa.SeatAvailability, error)

type MetropolitanArea

type MetropolitanArea struct {
	Code     string    `json:"code"`
	Name     string    `json:"name"`
	Airports []Airport `json:"airports"`
}

type MinimalS3Client

type MinimalS3Client interface {
	adapt.S3Getter
	adapt.S3Lister
	adapt.S3Putter
}

type QueryScheduleOption

type QueryScheduleOption func(*querySchedulesOptions) error

func WithAircraftConfigurationVersion

func WithAircraftConfigurationVersion(aircraftConfigurationVersion string) QueryScheduleOption

func WithAircraftType

func WithAircraftType(aircraftType string) QueryScheduleOption

func WithAirlines

func WithAirlines(airlines ...common.AirlineIdentifier) QueryScheduleOption

func WithAll

func WithAny

func WithArrivalAirport

func WithArrivalAirport(airport string) QueryScheduleOption

func WithDepartureAirport

func WithDepartureAirport(airport string) QueryScheduleOption

func WithFlightNumber

func WithFlightNumber(fn common.FlightNumber) QueryScheduleOption

func WithIgnoreCodeShares

func WithIgnoreCodeShares() QueryScheduleOption

func WithMaxDepartureTime

func WithMaxDepartureTime(maxDepartureTime time.Time) QueryScheduleOption

func WithMinDepartureTime

func WithMinDepartureTime(minDepartureTime time.Time) QueryScheduleOption

func WithServiceType

func WithServiceType(serviceType string) QueryScheduleOption

Jump to

Keyboard shortcuts

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