From fd70f95224374d23157ee7c0357733102cd0df53 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Sun, 18 Aug 2024 13:29:54 +0300 Subject: initial --- pkg/models/point.go | 18 ++++++++++++++++++ pkg/models/user.go | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 pkg/models/point.go create mode 100644 pkg/models/user.go (limited to 'pkg/models') diff --git a/pkg/models/point.go b/pkg/models/point.go new file mode 100644 index 0000000..4cdcc60 --- /dev/null +++ b/pkg/models/point.go @@ -0,0 +1,18 @@ +package models + +import ( + "time" + + "go.neonxp.ru/objectid" +) + +type Point struct { + ID objectid.ID `json:"id"` + UserID objectid.ID `json:"user_id"` + Lat float64 `json:"lat"` + Lon float64 `json:"lon"` + Time time.Time `json:"time"` + Speed float64 `json:"speed"` + Direction float64 `json:"direction"` + Accuracy float64 `json:"accuracy"` +} diff --git a/pkg/models/user.go b/pkg/models/user.go new file mode 100644 index 0000000..5eacd7e --- /dev/null +++ b/pkg/models/user.go @@ -0,0 +1,17 @@ +package models + +import ( + "encoding/gob" + + "go.neonxp.ru/objectid" +) + +func init() { + gob.Register(new(User)) +} + +type User struct { + ID objectid.ID `json:"id"` + Email string `json:"email"` + Password []byte `json:"password"` +} -- cgit v1.2.3