Documentation ¶
Index ¶
Constants ¶
View Source
const MeteocielHourFormat = "15:04"
Variables ¶
View Source
var MeteocielDays = []string{"Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"}
View Source
var WeatherTypes = map[string]WeatherType{
"soleil": {
Name: "Sunny",
},
"voile": {
Name: "Little cloudy",
},
"peu_nuageux": {
Name: "Partly cloudy",
},
"mitige": {
Name: "Mixed",
},
"nuageux": {
Name: "Cloudy",
},
"brouillard": {
Name: "Foggy",
},
"pluie": {
Name: "Rainy",
},
"grele": {
Name: "Hail",
},
"neige": {
Name: "Snowy",
},
"averse_pluiefaible": {
Name: "Light rain shower",
},
"averse_pluie": {
Name: "Rain shower",
},
"averse_neige": {
Name: "Snow shower",
},
"averse_orage": {
Name: "Thunderstorm",
},
"averse_pluieneige": {
Name: "Rain and snow shower",
},
"pluie_neige": {
Name: "Rain and snow",
},
"oragefaible": {
Name: "Major thunderstorm",
},
}
Functions ¶
This section is empty.
Types ¶
type ForecastType ¶
type ForecastType string
const ( ForecastGFS ForecastType = "https://www.meteociel.fr/previsions/{stationId}/{station}.htm" ForecastWRF ForecastType = "https://www.meteociel.fr/previsions-wrf/{stationId}/{station}.htm" ForecastWRF1H ForecastType = "https://www.meteociel.fr/previsions-wrf-1h/{stationId}/{station}.htm" ForecastAROME ForecastType = "https://www.meteociel.fr/previsions-arome/{stationId}/{station}.htm" ForecastAROME1H ForecastType = "https://www.meteociel.fr/previsions-arome-1h/{stationId}/{station}.htm" ForecastARPEGE1H ForecastType = "https://www.meteociel.fr/previsions-arpege-1h/{stationId}/{station}.htm" ForecastICONEU ForecastType = "https://www.meteociel.fr/previsions-iconeu/{stationId}/{station}.htm" ForecastICOND2 ForecastType = "https://www.meteociel.fr/previsions-icond2/{stationId}/{station}.htm" ForecastTrends10J ForecastType = "https://www.meteociel.fr/tendances/{stationId}/{station}.htm" )
type MeteocielClient ¶
MeteocielClient This struct represents a Meteociel client.
func CreateClient ¶
func CreateClient() *MeteocielClient
CreateClient This method creates a new Meteociel client.
func (MeteocielClient) GetForecast ¶
func (client MeteocielClient) GetForecast(forecast ForecastType, station MeteocielStation) (forecasts []MeteocielForecast, err error)
GetForecast This method returns the forecast for a given station. Depending on the type of forecast you have chosen, the data may be different and some elements may not be present.
func (MeteocielClient) GetStationForCity ¶
func (client MeteocielClient) GetStationForCity(exactName string) (station MeteocielStation, err error)
GetStationForCity This method returns the Meteociel station for a given city. You MUST provide the exact ZIP code or the name of the city, otherwise the method will return an error.
type MeteocielForecast ¶
type MeteocielStation ¶
MeteocielStation This struct represents a Meteociel station. You can use it to get forecasts for a given station.
type StationEndpoint ¶
type StationEndpoint string
const (
StationSearch StationEndpoint = "https://www.meteociel.fr/prevville.php?action=getville&villeid=&ville={city}&envoyer=OK"
)
type WeatherType ¶
type WeatherType struct {
Name string
}
Click to show internal directories.
Click to hide internal directories.