updated fuelprices
This commit is contained in:
parent
497ae6c1c6
commit
6226989aad
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
*.ini
|
||||
fuelprices
|
||||
/fuelprices
|
||||
|
42
cmd/fuelprices/fuelprices.go
Normal file
42
cmd/fuelprices/fuelprices.go
Normal 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)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user