model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

model/types.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DailyWeatherDetails

type DailyWeatherDetails struct {
	AverageTemp   float64
	CommonWeather string
	WPI           float64
	AverageWind   float64
	Icon          string
	Day           time.Weekday
}

type DestinationInfo

type DestinationInfo struct {
	IATA                string
	City                string
	Country             string
	SkyScannerURL       string
	SkyScannerID        string
	SkyScannerPrice     float64
	SkyScannerNextPrice float64
	AirbnbURL           string
	BookingURL          string
	WPI                 float64
	WeatherDetails      []DailyWeatherDetails
}

AirportInfo holds the details for an airport.

type OriginInfo

type OriginInfo struct {
	IATA                   string
	City                   string
	Country                string
	DepartureStartDate     string
	DepartureEndDate       string
	ArrivalStartDate       string
	ArrivalEndDate         string
	NextDepartureStartDate string
	NextDepartureEndDate   string
	NextArrivalStartDate   string
	NextArrivalEndDate     string
	SkyScannerID           string
}

AirportInfo holds the details for an airport.

type PersistentPrices

type PersistentPrices struct {
	Data map[PriceKey]PriceData
}

type PriceData

type PriceData struct {
	Price float64
}

PriceData now just holds the price, as the IDs are embedded in the key of the map.

type PriceKey

type PriceKey struct {
	OriginID      string
	DestinationID string
}

type WeatherData

type WeatherData struct {
	Dt   int64 `json:"dt"` // Unix timestamp of the forecasted data
	Main struct {
		Temp float64 `json:"temp"`
	} `json:"main"`
	Wind struct {
		Speed float64 `json:"speed"`
	} `json:"wind"`
	Weather []struct {
		Main        string `json:"main"`
		Description string `json:"description"`
		Icon        string `json:"icon"`
	} `json:"weather"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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