Documentation ¶
Overview ¶
Package mevv is for accessing "MacroExpert VillĂĄmVilĂĄg" service.
Index ¶
- Constants
- Variables
- func ReadUserPassw(filename string) (string, string, error)
- type Options
- type V3DailyBool
- type V3DailyFloat
- type V3DailyLightning
- type V3DailyMinMax
- type V3DailyWind
- type V3Drought
- type V3Error
- type V3File
- type V3Hourly
- type V3HourlyPrecip
- type V3HourlyTemp
- type V3HourlyWind
- type V3MeasureTemp
- type V3MeasureWind
- type V3Measurement
- type V3Query
- type V3Request
- type V3Response
- type V3ResultData
- type V3Statistic
- type V3Visibility
- type Version
- func (V Version) GetPDF(ctx context.Context, username, password string, opt Options) (rc io.ReadCloser, fileName, mimeType string, err error)
- func (V Version) GetPDFData(ctx context.Context, username, password string, opt Options) (data V3ResultData, r io.ReadCloser, fileName, mimeType string, err error)
- func (V Version) LatKey() string
- func (V Version) LngKey() string
- func (V Version) RefKey() string
- func (V Version) URL() string
Constants ¶
const ( V0 = Version("v0") V1 = Version("v1") V2 = Version("v2") V3 = Version("v3") )
const (
MacroExpertURLv3Test = `https://frontend-test.macrometeo.hu/webapi/query-civil`
)
Variables ¶
var ErrAuth = errors.New("authentication error")
Functions ¶
Types ¶
type Options ¶
type Options struct {
Since, Till time.Time `json:"-"`
At time.Time `json:"eventDate"`
Address string `json:"address"`
ContractID string `json:"referenceNo"`
URL string `json:"-"`
Lat float64 `json:"locationLat"`
Lng float64 `json:"locationLon"`
Interval int `json:"interval"`
NeedThunders, NeedIce, NeedWinds bool `json:"-"`
NeedRains, NeedRainsIntensity bool `json:"-"`
NeedTemperature bool `json:"-"`
ExtendedLightning bool `json:"extendedRange"`
NeedPDF, NeedData bool `json:"-"`
WithStatistics bool `json:"withStatistic"`
Hourly bool `json:"-"`
}
Options are the space/time coordinates and the required details.
type V3DailyBool ¶ added in v0.27.2
type V3DailyFloat ¶ added in v0.27.2
type V3DailyLightning ¶ added in v0.27.2
type V3DailyLightning struct { EventDateUTC time.Time `json:"eventDateUtc"` EventDate time.Time `json:"eventDate"` Zone json.Number `json:"zone"` // Type json.Number `json:"lightningType"` Index int `json:"index"` Altitude float64 `json:"altitude"` CurrentIntensity float64 `json:"currentIntensity"` DistanceFromOrigin float64 `json:"distanceFromOrigin"` Inaccuracy float64 `json:"inaccuracy"` }
type V3DailyMinMax ¶ added in v0.27.2
type V3DailyWind ¶ added in v0.27.2
type V3DailyWind struct { V3DailyMinMax Code float64 `json:"code"` }
type V3Error ¶ added in v0.26.11
type V3Hourly ¶ added in v0.27.2
type V3HourlyPrecip ¶ added in v0.27.2
type V3HourlyTemp ¶ added in v0.27.2
type V3HourlyWind ¶ added in v0.27.2
type V3MeasureTemp ¶ added in v0.27.2
type V3MeasureTemp struct {
V3Measurement
}
type V3MeasureWind ¶ added in v0.27.2
type V3MeasureWind struct { V3Measurement Direction string `json:"directionCode"` MaxGustKmH float64 `json:"maxGustKmH"` }
type V3Measurement ¶ added in v0.26.11
type V3Measurement struct { Date string `json:"dateString"` Hour string `json:"hour"` Code json.Number `json:"code"` Settlement string `json:"settlementText"` Value json.RawMessage `json:"value"` Altitude float64 `json:"altitude"` DistanceFromOrigin float64 `json:"distanceFromOrigin"` PrecipitationMax float64 `json:"precipitationMax"` TemperatureMin float64 `json:"temperatureMin"` TemperatureMax float64 `json:"temperatureMax"` MinValue float64 `json:"minValue"` MaxValue float64 `json:"maxValue"` DroughtIndex1 bool `json:"droughtIndex"` DroughtIndex2 bool `json:"droughtIndex2"` }
type V3Query ¶ added in v0.26.11
type V3Response ¶ added in v0.26.11
type V3Response struct { Data V3ResultData `json:"resultData"` File V3File `json:"file"` Errors []V3Error `json:"errors"` OperationID int `json:"operationId"` Successful bool `json:"isSuccessful"` }
type V3ResultData ¶ added in v0.26.11
type V3ResultData struct { DateFrom time.Time `json:"dateFrom"` DateTo time.Time `json:"dateTo"` EventDate time.Time `json:"eventDate"` Address string `json:"address"` ReferenceNo string `json:"referenceNo"` DailyListWind []V3DailyWind `json:"dailyListWind"` DailyListPrecipitation []V3DailyFloat `json:"dailyListPrecipitation"` DailyListPrecipitationIntensity []V3DailyBool `json:"dailyListPrecipitationIntensity"` DailyListIce []V3DailyBool `json:"dailyListIce"` DailyListTemperature []V3DailyMinMax `json:"dailyListTemperature"` LightningList []V3DailyLightning `json:"lightingList"` ByStationPrecipList []V3HourlyPrecip `json:"byStationPrecList"` ByStationTempList []V3HourlyTemp `json:"byStationTempList"` ByStationWindList []V3HourlyWind `json:"byStationWindList"` AgroFrostList []V3Measurement `json:"agroFrostList"` AgroExtendedList []V3Measurement `json:"agroFrostExtendedList"` Drought []V3Drought `json:"agroDroughtList"` DroughtExtendedList []V3Measurement `json:"agroDroughtExtendedList"` Statistics []V3Statistic `json:"statisticsList"` Raw json.RawMessage `json:"-"` Lat float64 `json:"locationLat"` Lon float64 `json:"locationLon"` Interval int `json:"interval"` LightningRadius int `json:"lightningRadius"` Visibility V3Visibility `json:"visibility"` }
type V3Statistic ¶ added in v0.26.11
type V3Visibility ¶ added in v0.26.11
type V3Visibility struct { Daily bool `json:"hasDailyData"` DailyWind bool `json:"hasDailyData_Wind"` DailyPrecipitation bool `json:"hasDailyData_Precipitation"` DailyPrecipitationIntensity bool `json:"hasDailyData_PrecipitationIntensity"` DailyIce bool `json:"hasDailyData_Ice"` DailyTemperature bool `json:"hasDailyData_Temperature"` Lightning bool `json:"hasLightingData"` ByStationTemperature bool `json:"hasByStationTemperature"` ByStationPrecipitation bool `json:"hasByStationPrecipitation"` ByStationWind bool `json:"hasByStationWind"` AgroFrost bool `json:"hasAgroFrost"` AgroFrostExtended bool `json:"hasAgroFrostExtended"` AgroDrought bool `json:"hasAgroDrought"` AgroDroughtExtended bool `json:"hasAgroDroughtExtended"` Statistic bool `json:"hasStatistic"` }
type Version ¶
type Version string
func (Version) GetPDF ¶
func (V Version) GetPDF( ctx context.Context, username, password string, opt Options, ) (rc io.ReadCloser, fileName, mimeType string, err error)
GetPDF returns the meteorological data in PDF form.
address M varchar(45) Keresett cĂm hĂĄzszĂĄmmal lat M float(8,5) SzĂŠlessĂŠg pl.: â��47.17451â�� lng M float(8,5) HosszĂşsĂĄg pl.: â��17.04234â�� from_date M date(YYYY-MM-DD) KezdĹ� datum pl.: â��2014-11-25â�� to_date M date(YYYY-MM-DD) ZĂĄrĂł datum pl.: â��2014-11-29â�� contr_id O varchar(25) KĂĄrszĂĄm pl.: â��KSZ-112233â�� needThunders O varchar(1) VillĂĄm adatokat kĂŠrek â��1â��â��kĂŠrem, â��0â��-nem needRains O varchar(1) CsapadĂŠk adatokat kĂŠrek â��1â��â��kĂŠrem, â��0â��-nem needWinds O varchar(1) SzĂŠl adatokat kĂŠrek â��1â�� â�� kĂŠrem, â��0â��-nem needRainsInt O varchar(1) Fix - â��0â�� language O varchar(2) Fix - â��huâ��
func (Version) GetPDFData ¶ added in v0.27.2
func (V Version) GetPDFData( ctx context.Context, username, password string, opt Options, ) (data V3ResultData, r io.ReadCloser, fileName, mimeType string, err error)