search

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportConnectionsImage

func ExportConnectionsImage(ctx context.Context, w io.Writer, conns []Connection) error

Types

type Connection

type Connection struct {
	Flight   *common.Flight
	Outgoing []Connection
}

type ConnectionResponse

type ConnectionResponse struct {
	FlightId common.FlightId      `json:"flightId"`
	Outgoing []ConnectionResponse `json:"outgoing"`
}

type ConnectionSearchOption

type ConnectionSearchOption interface {
	Apply(f *Options)
}

type ConnectionsHandler

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

func NewConnectionsHandler

func NewConnectionsHandler(fr *FlightRepo) *ConnectionsHandler

func (*ConnectionsHandler) FindConnections

func (ch *ConnectionsHandler) FindConnections(ctx context.Context, origins, destinations []string, minDeparture, maxDeparture time.Time, maxFlights uint32, minLayover, maxLayover, maxDuration time.Duration, options ...ConnectionSearchOption) ([]Connection, error)

type ConnectionsResponse

type ConnectionsResponse struct {
	Connections []ConnectionResponse               `json:"connections"`
	Flights     map[common.FlightId]FlightResponse `json:"flights"`
}

func ExportConnectionsJson

func ExportConnectionsJson(conns []Connection) ConnectionsResponse

type FlightNumberResponse

type FlightNumberResponse struct {
	Airline string `json:"airline"`
	Number  int    `json:"number"`
	Suffix  string `json:"suffix,omitempty"`
}

type FlightRepo

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

func NewFlightRepo

func NewFlightRepo(s3c MinimalS3Client, bucket string) *FlightRepo

func (*FlightRepo) Flights

func (fr *FlightRepo) Flights(ctx context.Context, start, end xtime.LocalDate) (map[xtime.LocalDate][]*common.Flight, error)

type FlightResponse

type FlightResponse struct {
	FlightNumber     FlightNumberResponse   `json:"flightNumber"`
	DepartureTime    time.Time              `json:"departureTime"`
	DepartureAirport string                 `json:"departureAirport"`
	ArrivalTime      time.Time              `json:"arrivalTime"`
	ArrivalAirport   string                 `json:"arrivalAirport"`
	AircraftOwner    string                 `json:"aircraftOwner"`
	AircraftType     string                 `json:"aircraftType"`
	Registration     string                 `json:"registration,omitempty"`
	CodeShares       []FlightNumberResponse `json:"codeShares"`
}

type MinimalS3Client

type MinimalS3Client adapt.S3Getter

type Options

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

type WithCountMultiLeg

type WithCountMultiLeg bool

func (WithCountMultiLeg) Apply

func (a WithCountMultiLeg) Apply(f *Options)

type WithExcludeAircraft

type WithExcludeAircraft []string

func (WithExcludeAircraft) Apply

func (a WithExcludeAircraft) Apply(f *Options)

type WithExcludeAircraftGlob

type WithExcludeAircraftGlob []string

func (WithExcludeAircraftGlob) Apply

func (a WithExcludeAircraftGlob) Apply(f *Options)

type WithExcludeAirport

type WithExcludeAirport []string

func (WithExcludeAirport) Apply

func (a WithExcludeAirport) Apply(f *Options)

type WithExcludeAirportGlob

type WithExcludeAirportGlob []string

func (WithExcludeAirportGlob) Apply

func (a WithExcludeAirportGlob) Apply(f *Options)

type WithExcludeFlightNumber

type WithExcludeFlightNumber []string

func (WithExcludeFlightNumber) Apply

func (a WithExcludeFlightNumber) Apply(f *Options)

type WithExcludeFlightNumberGlob

type WithExcludeFlightNumberGlob []string

func (WithExcludeFlightNumberGlob) Apply

type WithIncludeAircraft

type WithIncludeAircraft string

func (WithIncludeAircraft) Apply

func (a WithIncludeAircraft) Apply(f *Options)

type WithIncludeAircraftGlob

type WithIncludeAircraftGlob string

func (WithIncludeAircraftGlob) Apply

func (a WithIncludeAircraftGlob) Apply(f *Options)

type WithIncludeAirport

type WithIncludeAirport string

func (WithIncludeAirport) Apply

func (a WithIncludeAirport) Apply(f *Options)

type WithIncludeAirportGlob

type WithIncludeAirportGlob string

func (WithIncludeAirportGlob) Apply

func (a WithIncludeAirportGlob) Apply(f *Options)

type WithIncludeFlightNumber

type WithIncludeFlightNumber string

func (WithIncludeFlightNumber) Apply

func (a WithIncludeFlightNumber) Apply(f *Options)

type WithIncludeFlightNumberGlob

type WithIncludeFlightNumberGlob string

func (WithIncludeFlightNumberGlob) Apply

Jump to

Keyboard shortcuts

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