From 2f4b6e90597784a8a7c01027e0ff5c6b69634a96 Mon Sep 17 00:00:00 2001 From: Alexander NeonXP Kiryukhin Date: Thu, 30 May 2019 14:05:08 +0300 Subject: Parallel write Speedup --- models.go | 60 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'models.go') 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"` } -- cgit v1.2.3