mevv

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package mevv is for accessing "MacroExpert VillĂĄmVilĂĄg" service.

Index

Constants

View Source
const (
	V0     = Version("v0")
	V1     = Version("v1")
	V2     = Version("v2")
	V3     = Version("v3")
	V3test = Version("v3-test")
)
View Source
const (
	TestHost = "40.68.241.196"
)

Variables

View Source
var ErrAuth = errors.New("authentication error")

Functions

func ReadUserPassw

func ReadUserPassw(filename string) (string, string, error)

ReadUserPassw reads the user/passw from the given file.

Types

type Options

type Options struct {
	Since, Till                      time.Time `json:"-"`
	At                               time.Time `json:"eventDate"`
	Address                          string    `json:"address"`
	ContractID                       string    `json:"referenceNo"`
	Host                             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"`
}

Options are the space/time coordinates and the required details.

func (*Options) Prepare added in v0.26.11

func (opt *Options) Prepare()

type V3Drought added in v0.26.11

type V3Drought struct {
	FromDate       string
	ToDate         string `json:"toDate"`
	Index1, Index2 bool
}

type V3Error added in v0.26.11

type V3Error struct {
	Field   string      `json:"fieldName"`
	Code    json.Number `json:"errorCode"`
	Message string      `json:"errorMessage"`
	Serious bool        `json:"isSerious"`
}

func (V3Error) Error added in v0.26.11

func (ve V3Error) Error() string

type V3File added in v0.26.11

type V3File struct {
	UUID        string `json:"uuid"`
	Name        string `json:"fileName"`
	ContentType string `json:"contentType"`
	Data        []byte `json:"data"`
}

type V3Lightning added in v0.26.11

type V3Lightning struct {
	EventDateUTC       time.Time `json:"eventDateUtc"`
	EventDate          time.Time `json:"eventDate"`
	Zone               string
	Type               string `json:"lightningType"`
	Index              int
	Altitude           float64 `json:"altitude"`
	CurrentIntensity   float64 `json:"currentIntensity"`
	DistanceFromOrigin float64 `json:"distanceFromOrigin"`
}

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"`
	TemperatureMin   float64         `json:"temperatureMin"`
	TemperatureMax   float64         `json:"temperatureMax"`
	PrecipitationMax float64         `json:"precipitationMax"`
	DroughtIndex1    bool            `json:"droughtIndex"`
	DroughtIndex2    bool            `json:"droughtIndex2"`
}

type V3Query added in v0.26.11

type V3Query struct {
	ResultTypes        []string `json:"resultTypes"`
	SelectedOperations []string `json:"selectedOperations"`
	Options
}

func (*V3Query) Prepare added in v0.26.11

func (req *V3Query) Prepare()

type V3Request added in v0.26.11

type V3Request struct {
	Username string  `json:"userName"`
	Password string  `json:"password"`
	Query    V3Query `json:"query"`
}

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                   []V3Measurement `json:"dailyListWind"`
	DailyListPrecipitation          []V3Measurement `json:"dailyListPrecipitation"`
	DailyListPrecipitationIntensity []V3Measurement `json:"dailyListPrecipitationIntensity"`
	DailyListIce                    []V3Measurement `json:"dailyListIce"`
	DailyListTemperature            []V3Measurement `json:"dailyListTemperature"`
	LightningList                   []V3Lightning   `json:"lightingList"`
	ByStationList                   []V3Measurement `json:"byStationList"`
	AgroFrostList                   []V3Measurement `json:"agroFrostList"`
	AgroExtendedList                []V3Measurement `json:"agroFrostExtendedList"`
	Drought                         []V3Drought     `json:"agroDroughtList"`
	DroughtExtendedList             []V3Measurement `json:"agroDroughtExtendedList"`
	Statistics                      []V3Statistic   `json:"statisticsList"`
	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 V3Statistic struct {
	OperationTypeName string  `json:"operationTypeName"`
	Sum               float64 `json:"sum"`
}

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) LatKey added in v0.26.10

func (V Version) LatKey() string

func (Version) LngKey

func (V Version) LngKey() string

func (Version) RefKey

func (V Version) RefKey() string

func (Version) URL

func (V Version) URL() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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