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

View file

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

View file

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

View file

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