aboutsummaryrefslogtreecommitdiff
path: root/models.go
diff options
context:
space:
mode:
authorAlexander NeonXP Kiryukhin <a.kiryukhin@mail.ru>2019-05-30 14:05:08 +0300
committerAlexander NeonXP Kiryukhin <a.kiryukhin@mail.ru>2019-05-30 14:05:08 +0300
commit2f4b6e90597784a8a7c01027e0ff5c6b69634a96 (patch)
tree5d94daf9fc394425b03baf3915ffd03a0011e442 /models.go
parent97fd40df4d85d91f3414dc88aa96222c1d827b49 (diff)
Parallel write
Speedup
Diffstat (limited to 'models.go')
-rw-r--r--models.go60
1 files changed, 30 insertions, 30 deletions
diff --git a/models.go b/models.go
index c98ed2f..dd187d2 100644
--- a/models.go
+++ b/models.go
@@ -9,54 +9,54 @@ import (
)
type Coords struct {
- Type string `bson:"type"`
- Coordinates []float64 `bson:"coordinates"`
+ Type string `json:"type" bson:"type"`
+ Coordinates []float64 `json:"coordinates" bson:"coordinates"`
}
type Node struct {
- ID primitive.ObjectID `bson:"_id,omitempty"`
- OsmID int64 `bson:"osm_id"`
- Visible bool `bson:"visible"`
- Version int `bson:"version,omitempty"`
- Timestamp time.Time `bson:"timestamp"`
- Tags []Tag `bson:"tags,omitempty"`
- Location Coords `bson:"location"`
+ ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
+ OsmID int64 `json:"osm_id" bson:"osm_id"`
+ Visible bool `json:"visible" bson:"visible"`
+ Version int `json:"version,omitempty" bson:"version,omitempty"`
+ Timestamp time.Time `json:"timestamp" bson:"timestamp"`
+ Tags []Tag `json:"tags,omitempty" bson:"tags,omitempty"`
+ Location Coords `json:"location" bson:"location"`
}
type Way struct {
- ID primitive.ObjectID `bson:"_id,omitempty"`
- OsmID int64 `bson:"osm_id"`
- Visible bool `bson:"visible"`
- Version int `bson:"version"`
- Timestamp time.Time `bson:"timestamp"`
- Nodes []int64 `bson:"nodes"`
- Tags []Tag `bson:"tags"`
+ ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
+ OsmID int64 `json:"osm_id" bson:"osm_id"`
+ Visible bool `json:"visible" bson:"visible"`
+ Version int `json:"version" bson:"version"`
+ Timestamp time.Time `json:"timestamp" bson:"timestamp"`
+ Nodes []int64 `json:"nodes" bson:"nodes"`
+ Tags []Tag `json:"tags" bson:"tags"`
}
type Relation struct {
- ID primitive.ObjectID `bson:"_id,omitempty"`
- OsmID int64 `bson:"osm_id"`
- Visible bool `bson:"visible"`
- Version int `bson:"version"`
- Timestamp time.Time `bson:"timestamp"`
- Members []Member `bson:"members"`
- Tags []Tag `bson:"tags"`
+ ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
+ OsmID int64 `json:"osm_id" bson:"osm_id"`
+ Visible bool `json:"visible" bson:"visible"`
+ Version int `json:"version" bson:"version"`
+ Timestamp time.Time `json:"timestamp" bson:"timestamp"`
+ Members []Member `json:"members" bson:"members"`
+ Tags []Tag `json:"tags" bson:"tags"`
}
type Member struct {
- Type osm.Type `bson:"type"`
- Ref int64 `bson:"ref"`
- Role string `bson:"role"`
+ Type osm.Type `json:"type" bson:"type"`
+ Ref int64 `json:"ref" bson:"ref"`
+ Role string `json:"role" bson:"role"`
Version int
- Location Coords `bson:"location"`
+ Location *Coords `json:"location,omitempty" bson:"location,omitempty"`
// Orientation is the direction of the way around a ring of a multipolygon.
// Only valid for multipolygon or boundary relations.
- Orientation orb.Orientation `bson:"orienation,omitempty"`
+ Orientation orb.Orientation `json:"orienation,omitempty" bson:"orienation,omitempty"`
}
type Tag struct {
- Key string `bson:"key"`
- Value string `bson:"value"`
+ Key string `json:"key" bson:"key"`
+ Value string `json:"value" bson:"value"`
}