meteo

package
v0.0.0-...-3634e44 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const FileFormat = "synop.%s.csv"

ex: https://donneespubliques.meteofrance.fr/donnees_libres/Txt/Synop/synop.2023082315.csv

View Source
const OWApiUrlFormat = "https://api.openweathermap.org/data/2.5/forecast?lat=%.5f&lon=%.5f&appid=%s&units=metric"
View Source
const URLFormat = "https://donneespubliques.meteofrance.fr/donnees_libres/Txt/Synop/%s"

Variables

View Source
var OrderedStationId = []string{
	"07005",
	"07761",
	"07139",
	"07790",
	"07510",
	"07255",
	"07110",
	"07027",
	"07460",
	"07280",
	"07535",
	"07015",
	"07434",
	"07481",
	"07650",
	"07558",
	"07607",
	"07577",
	"07643",
	"07299",
	"07181",
	"07222",
	"07690",
	"07149",
	"07747",
	"07335",
	"07471",
	"07072",
	"07130",
	"07037",
	"07190",
	"07621",
	"07630",
	"07240",
	"07168",
}
View Source
var PublicationsHours = []int{0, 3, 6, 9, 12, 15, 18, 21}
View Source
var StationIdToName = map[string]string{
	"07005": "ABBEVILLE",
	"07015": "LILLE",
	"07027": "CAEN",
	"07037": "ROUEN",
	"07072": "REIMS",
	"07110": "BREST",
	"07130": "RENNES",
	"07139": "ALENCON",
	"07149": "PARIS",
	"07168": "TROYES",
	"07181": "NANCY",
	"07190": "STRASBOURG",
	"07222": "NANTES",
	"07240": "TOURS",
	"07255": "BOURGES",
	"07280": "DIJON",
	"07299": "MULHOUSE",
	"07335": "POITIERS",
	"07434": "LIMOGES",
	"07460": "CLERMONT-FD",
	"07471": "LE PUY",
	"07481": "LYON",
	"07510": "BORDEAUX",
	"07535": "GOURDON",
	"07558": "MILLAU",
	"07577": "MONTELIMAR",
	"07607": "MONT-DE-MARSAN",
	"07621": "TARBES",
	"07630": "TOULOUSE",
	"07643": "MONTPELLIER",
	"07650": "MARSEILLE",
	"07690": "NICE",
	"07747": "PERPIGNAN",
	"07761": "AJACCIO",
	"07790": "BASTIA",
}

Functions

func MeteoService

func MeteoService(m *minigo.Minitel, communeDB *databases.CommuneDatabase) int

func NewCodePostalPage

func NewCodePostalPage(mntl *minigo.Minitel) *minigo.Page

func NewCommunesPage

func NewCommunesPage(mntl *minigo.Minitel, cDB *databases.CommuneDatabase, selectedCP map[string]string) *minigo.Page

func NewObservationsPage

func NewObservationsPage(mntl *minigo.Minitel) *minigo.Page

func NewPrevisionPage

func NewPrevisionPage(mntl *minigo.Minitel, communeMap map[string]string) *minigo.Page

Types

type OpenWeatherApiResponse

type OpenWeatherApiResponse struct {
	Cod     string `json:"cod"`
	Message int    `json:"message"`
	Cnt     int    `json:"cnt"`
	List    []struct {
		Dt   int64 `json:"dt"`
		Main struct {
			Temp      float64 `json:"temp"`
			FeelsLike float64 `json:"feels_like"`
			TempMin   float64 `json:"temp_min"`
			TempMax   float64 `json:"temp_max"`
			Pressure  int     `json:"pressure"`
			SeaLevel  int     `json:"sea_level"`
			GrndLevel int     `json:"grnd_level"`
			Humidity  int     `json:"humidity"`
			TempKf    float64 `json:"temp_kf"`
		} `json:"main"`
		Weather []struct {
			ID          int    `json:"id"`
			Main        string `json:"main"`
			Description string `json:"description"`
			Icon        string `json:"icon"`
		} `json:"weather"`
		Clouds struct {
			All int `json:"all"`
		} `json:"clouds"`
		Wind struct {
			Speed float64 `json:"speed"`
			Deg   int     `json:"deg"`
			Gust  float64 `json:"gust"`
		} `json:"wind"`
		Visibility int     `json:"visibility"`
		Pop        float64 `json:"pop"`
		Rain       struct {
			ThreeH float64 `json:"3h"`
		} `json:"rain,omitempty"`
		Sys struct {
			Pod string `json:"pod"`
		} `json:"sys"`
		DtTxt string `json:"dt_txt"`
	} `json:"list"`
	City struct {
		ID    int    `json:"id"`
		Name  string `json:"name"`
		Coord struct {
			Lat float64 `json:"lat"`
			Lon float64 `json:"lon"`
		} `json:"coord"`
		Country    string `json:"country"`
		Population int    `json:"population"`
		Timezone   int    `json:"timezone"`
		Sunrise    int64  `json:"sunrise"`
		Sunset     int64  `json:"sunset"`
	} `json:"city"`
}

type WeatherReport

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

Jump to

Keyboard shortcuts

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