mirror of
https://github.com/Cernobor/oko-server.git
synced 2025-02-24 08:27:17 +00:00
App version management.
* DB migration adds app_versions table for managing known app versions. * /ping reads app version from User-Agent header and responds with latest version if the app is OKO and its version is older than the latest one stored. * Added endpoint /app-versions which * lists all known versions via GET * adds/updates a version via POST #3 Fix #4
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/coreos/go-semver/semver"
|
||||
geojson "github.com/paulmach/go.geojson"
|
||||
)
|
||||
|
||||
@@ -40,6 +41,11 @@ type BuildInfo struct {
|
||||
|
||||
// transport objects
|
||||
|
||||
type AppVersionInfo struct {
|
||||
Version semver.Version `json:"version"`
|
||||
Address string `json:"address"`
|
||||
}
|
||||
|
||||
type Coords struct {
|
||||
Lat float64 `json:"lat"`
|
||||
Lng float64 `json:"lng"`
|
||||
|
||||
Reference in New Issue
Block a user