This commit is contained in:
genofire 2019-12-28 17:44:54 +01:00 committed by Timm
commit 89ae122fc3
9 changed files with 113 additions and 114 deletions

View file

@ -1,16 +1,16 @@
package main package main
import ( import (
"github.com/gofrs/uuid"
"github.com/robfig/cron"
"net/http"
"encoding/json" "encoding/json"
"github.com/gofrs/uuid"
"github.com/gorilla/mux"
"github.com/robfig/cron"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
"log"
"io/ioutil" "io/ioutil"
"log"
"net/http"
"os" "os"
"time" "time"
"github.com/gorilla/mux"
) )
var config = ConfigFile{} var config = ConfigFile{}
@ -108,7 +108,7 @@ func loadSpaceData() {
timestamp := time.Now().Unix() timestamp := time.Now().Unix()
for _, spaceUrl := range spaceUrls { for _, spaceUrl := range spaceUrls {
if spaceUrl.Validated && int64(spaceUrl.LastUpdated + 60) < timestamp { if spaceUrl.Validated && int64(spaceUrl.LastUpdated+60) < timestamp {
spaceData := SpaceData{} spaceData := SpaceData{}
err := getJson(spaceUrl.Url, &spaceData) err := getJson(spaceUrl.Url, &spaceData)
if err != nil { if err != nil {

View file

@ -1,9 +1,9 @@
package main package main
import ( import (
"net/http"
"encoding/json" "encoding/json"
"fmt" "fmt"
"net/http"
) )
type DataObject interface { type DataObject interface {

View file

@ -1,9 +1,9 @@
package main package main
import ( import (
"net/http"
"github.com/gorilla/mux" "github.com/gorilla/mux"
"log" "log"
"net/http"
) )
func NewRouter() *mux.Router { func NewRouter() *mux.Router {

View file

@ -9,7 +9,6 @@ type Route struct {
Handler http.HandlerFunc Handler http.HandlerFunc
} }
type Routes []Route type Routes []Route
var IndexRoutes = Routes{ var IndexRoutes = Routes{