updated fuelprices

This commit is contained in:
Paul 2020-02-26 09:07:54 +01:00
parent 497ae6c1c6
commit 6226989aad
2 changed files with 43 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
*.ini
fuelprices
/fuelprices

View File

@ -0,0 +1,42 @@
package main
import (
"git.paulbsd.com/paulbsd/fuelprices/src/config"
"git.paulbsd.com/paulbsd/fuelprices/src/price"
"git.paulbsd.com/paulbsd/fuelprices/src/xmlfile"
"git.paulbsd.com/paulbsd/fuelprices/src/zipfile"
"log"
)
func main() {
var c config.Config
var zf zipfile.ZipFile
var xf xmlfile.XMLFile
var pcx []price.Price
var err error
err = c.GetConfig()
if err != nil {
log.Fatal(err)
}
err = zf.DownloadFile(&c)
if err != nil {
log.Fatal(err)
}
err = zf.ExtractZip(&c, &xf)
if err != nil {
log.Fatal(err)
}
err = price.GetPrices(&c, &pcx, &xf)
if err != nil {
log.Fatal(err)
}
err = price.SendToInflux(&c, &pcx)
if err != nil {
log.Fatal(err)
}
}