model

package
v0.0.0-...-ac60b16 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddReferencedAircraft

func AddReferencedAircraft(referencedAircraft iter.Seq[uuid.UUID], aircraft map[uuid.UUID]db.Aircraft, dst map[UUID]Aircraft)

Types

type Aircraft

type Aircraft struct {
	Id UUID
	*AircraftType
	*AircraftFamily
	Configurations map[UUID][]string
}

func AircraftFromDb

func AircraftFromDb(dbAc db.Aircraft) Aircraft

func (Aircraft) IataCode

func (ac Aircraft) IataCode() string

func (Aircraft) MarshalJSON

func (ac Aircraft) MarshalJSON() ([]byte, error)

func (Aircraft) Name

func (ac Aircraft) Name() string

type AircraftFamily

type AircraftFamily struct {
	ParentFamilyId *UUID  `json:"parentFamilyId,omitempty"`
	IataCode       string `json:"iataCode,omitempty"`
	Name           string `json:"name"`
}

type AircraftReport

type AircraftReport struct {
	Aircraft           Aircraft `json:"aircraft"`
	FlightsAndDuration [][2]int `json:"flightsAndDuration"`
}

type AircraftType

type AircraftType struct {
	ParentFamilyId *UUID  `json:"parentFamilyId,omitempty"`
	IataCode       string `json:"iataCode"`
	IcaoCode       string `json:"icaoCode,omitempty"`
	Name           string `json:"name"`
}

type Airline

type Airline struct {
	Id       UUID   `json:"id"`
	IataCode string `json:"iataCode"`
	IcaoCode string `json:"icaoCode,omitempty"`
	Name     string `json:"name"`
}

func AirlineFromDb

func AirlineFromDb(airline db.Airline) Airline

type Airport

type Airport struct {
	Id           UUID         `json:"id"`
	IataCode     string       `json:"iataCode"`
	IcaoCode     string       `json:"icaoCode,omitempty"`
	IataAreaCode string       `json:"iataAreaCode,omitempty"`
	CountryCode  string       `json:"countryCode,omitempty"`
	CityCode     string       `json:"cityCode,omitempty"`
	Type         string       `json:"type,omitempty"`
	Location     *GeoLocation `json:"location,omitempty"`
	Timezone     string       `json:"timezone,omitempty"`
	Name         string       `json:"name,omitempty"`
}

func AirportFromDb

func AirportFromDb(airport db.Airport) Airport

type ConnectionFlightResponse

type ConnectionFlightResponse struct {
	FlightNumber          FlightNumber   `json:"flightNumber"`
	DepartureTime         time.Time      `json:"departureTime"`
	DepartureAirportId    UUID           `json:"departureAirportId"`
	ArrivalTime           time.Time      `json:"arrivalTime"`
	ArrivalAirportId      UUID           `json:"arrivalAirportId"`
	AircraftOwner         string         `json:"aircraftOwner"`
	AircraftId            UUID           `json:"aircraftId"`
	AircraftConfiguration string         `json:"aircraftConfiguration"`
	CodeShares            []FlightNumber `json:"codeShares"`
}

type ConnectionGameChallenge

type ConnectionGameChallenge struct {
	Seed               string `json:"seed"`
	DepartureAirportId UUID   `json:"departureAirportId"`
	ArrivalAirportId   UUID   `json:"arrivalAirportId"`
}

type ConnectionResponse

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

type ConnectionsResponse

type ConnectionsResponse struct {
	Connections []ConnectionResponse              `json:"connections"`
	Flights     map[UUID]ConnectionFlightResponse `json:"flights"`
	Airlines    map[UUID]Airline                  `json:"airlines"`
	Airports    map[UUID]Airport                  `json:"airports"`
	Aircraft    map[UUID]Aircraft                 `json:"aircraft"`
}

type ConnectionsSearchRequest

type ConnectionsSearchRequest struct {
	Origins             []UUID    `json:"origins"`
	Destinations        []UUID    `json:"destinations"`
	MinDeparture        time.Time `json:"minDeparture"`
	MaxDeparture        time.Time `json:"maxDeparture"`
	MaxFlights          uint32    `json:"maxFlights"`
	MinLayoverMS        uint64    `json:"minLayoverMS"`
	MaxLayoverMS        uint64    `json:"maxLayoverMS"`
	MaxDurationMS       uint64    `json:"maxDurationMS"`
	CountMultiLeg       bool      `json:"countMultiLeg"`
	IncludeAirport      []string  `json:"includeAirport,omitempty"`
	ExcludeAirport      []string  `json:"excludeAirport,omitempty"`
	IncludeFlightNumber []string  `json:"includeFlightNumber,omitempty"`
	ExcludeFlightNumber []string  `json:"excludeFlightNumber,omitempty"`
	IncludeAircraft     []string  `json:"includeAircraft,omitempty"`
	ExcludeAircraft     []string  `json:"excludeAircraft,omitempty"`
}

func (ConnectionsSearchRequest) ToPb

type ConnectionsSearchResponse

type ConnectionsSearchResponse struct {
	Data   ConnectionsResponse       `json:"data"`
	Search *ConnectionsSearchRequest `json:"search,omitempty"`
}

type DestinationReport

type DestinationReport struct {
	Airport            Airport `json:"airport"`
	MinDurationSeconds int     `json:"minDurationSeconds"`
}

type FlightNumber

type FlightNumber struct {
	AirlineId UUID   `json:"airlineId"`
	Number    int    `json:"number"`
	Suffix    string `json:"suffix,omitempty"`
}

func FlightNumberFromDb

func FlightNumberFromDb(fn db.FlightNumber) FlightNumber

type FlightScheduleItem

type FlightScheduleItem struct {
	DepartureDateLocal xtime.LocalDate `json:"departureDateLocal"`
	DepartureAirportId UUID            `json:"departureAirportId"`
	FlightVariantId    *UUID           `json:"flightVariantId,omitempty"`
	Version            time.Time       `json:"version"`
	VersionCount       int             `json:"versionCount"`
}

func FlightScheduleItemFromDb

func FlightScheduleItemFromDb(item db.FlightScheduleItem) FlightScheduleItem

type FlightScheduleNumberAndItems

type FlightScheduleNumberAndItems struct {
	FlightNumber FlightNumber         `json:"flightNumber"`
	Items        []FlightScheduleItem `json:"items"`
}

type FlightScheduleUpdate

type FlightScheduleUpdate struct {
	FlightNumber       FlightNumber    `json:"flightNumber"`
	DepartureDateLocal xtime.LocalDate `json:"departureDateLocal"`
	DepartureAirportId UUID            `json:"departureAirportId"`
	IsRemoved          bool            `json:"isRemoved"`
}

func FlightScheduleUpdateFromDb

func FlightScheduleUpdateFromDb(item db.FlightScheduleUpdate) FlightScheduleUpdate

type FlightScheduleUpdates

type FlightScheduleUpdates struct {
	Updates  []FlightScheduleUpdate `json:"updates"`
	Airlines map[UUID]Airline       `json:"airlines"`
	Airports map[UUID]Airport       `json:"airports"`
}

func FlightScheduleUpdatesFromDb

func FlightScheduleUpdatesFromDb(items []db.FlightScheduleUpdate, airlines map[uuid.UUID]db.Airline, airports map[uuid.UUID]db.Airport) FlightScheduleUpdates

type FlightScheduleVariant

type FlightScheduleVariant struct {
	Id                           UUID            `json:"id"`
	OperatedAs                   FlightNumber    `json:"operatedAs"`
	DepartureTimeLocal           xtime.LocalTime `json:"departureTimeLocal"`
	DepartureUtcOffsetSeconds    int64           `json:"departureUtcOffsetSeconds"`
	DurationSeconds              int64           `json:"durationSeconds"`
	ArrivalAirportId             UUID            `json:"arrivalAirportId"`
	ArrivalUtcOffsetSeconds      int64           `json:"arrivalUtcOffsetSeconds"`
	ServiceType                  string          `json:"serviceType"`
	AircraftOwner                string          `json:"aircraftOwner"`
	AircraftId                   UUID            `json:"aircraftId"`
	AircraftConfigurationVersion string          `json:"aircraftConfigurationVersion"`
	CodeShares                   []FlightNumber  `json:"codeShares"`
}

func FlightScheduleVariantFromDb

func FlightScheduleVariantFromDb(variant db.FlightScheduleVariant) FlightScheduleVariant

type FlightScheduleVersion

type FlightScheduleVersion struct {
	Version         time.Time `json:"version"`
	FlightVariantId *UUID     `json:"flightVariantId,omitempty"`
}

type FlightScheduleVersions

type FlightScheduleVersions struct {
	FlightNumber       FlightNumber                   `json:"flightNumber"`
	DepartureDateLocal xtime.LocalDate                `json:"departureDateLocal"`
	DepartureAirportId UUID                           `json:"departureAirportId"`
	Versions           []FlightScheduleVersion        `json:"versions"`
	Variants           map[UUID]FlightScheduleVariant `json:"variants"`
	Airlines           map[UUID]Airline               `json:"airlines"`
	Airports           map[UUID]Airport               `json:"airports"`
	Aircraft           map[UUID]Aircraft              `json:"aircraft"`
}

type FlightSchedules

type FlightSchedules struct {
	FlightNumber         FlightNumber                   `json:"flightNumber"`
	RelatedFlightNumbers []FlightNumber                 `json:"relatedFlightNumbers"`
	Items                []FlightScheduleItem           `json:"items"`
	Variants             map[UUID]FlightScheduleVariant `json:"variants"`
	Airlines             map[UUID]Airline               `json:"airlines"`
	Airports             map[UUID]Airport               `json:"airports"`
	Aircraft             map[UUID]Aircraft              `json:"aircraft"`
}

type FlightSchedulesMany

type FlightSchedulesMany struct {
	Schedules []FlightScheduleNumberAndItems `json:"schedules"`
	Variants  map[UUID]FlightScheduleVariant `json:"variants"`
	Airlines  map[UUID]Airline               `json:"airlines"`
	Airports  map[UUID]Airport               `json:"airports"`
	Aircraft  map[UUID]Aircraft              `json:"aircraft"`
}

func FlightSchedulesManyFromDb

func FlightSchedulesManyFromDb(dbResult db.FlightSchedulesMany, airlines map[uuid.UUID]db.Airline, airports map[uuid.UUID]db.Airport, aircraft map[uuid.UUID]db.Aircraft) FlightSchedulesMany

type GeoLocation

type GeoLocation struct {
	Lng float64 `json:"lng"`
	Lat float64 `json:"lat"`
}

type SearchResponse

type SearchResponse struct {
	Airlines      []Airline      `json:"airlines"`
	FlightNumbers []FlightNumber `json:"flightNumbers"`
}

type UUID

type UUID uuid.UUID

func (*UUID) FromString

func (u *UUID) FromString(s string) error

func (UUID) MarshalJSON

func (u UUID) MarshalJSON() ([]byte, error)

func (UUID) MarshalText

func (u UUID) MarshalText() ([]byte, error)

func (UUID) String

func (u UUID) String() string

func (*UUID) UnmarshalJSON

func (u *UUID) UnmarshalJSON(b []byte) error

func (*UUID) UnmarshalText

func (u *UUID) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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