/
struct.go
123 lines (104 loc) · 3.74 KB
/
struct.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package ratu
import (
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Payload struct {
Name string `json:"name"`
Username string `json:"username"`
Role string `json:"role"`
Exp time.Time `json:"exp"`
Iat time.Time `json:"iat"`
Nbf time.Time `json:"nbf"`
}
type DBInfo struct {
DBString string
DBName string
CollectionName string
}
type User struct {
Name string `json:"name" bson:"name"`
Username string `json:"username" bson:"username"`
Password string `json:"password" bson:"password"`
Role string `json:"role" bson:"role"`
}
type CredentialUser struct {
Status bool `json:"status" bson:"status"`
Data struct {
Name string `json:"name" bson:"name"`
Username string `json:"username" bson:"username"`
Role string `json:"role" bson:"role"`
} `json:"data" bson:"data"`
Message string `json:"message,omitempty" bson:"message,omitempty"`
}
type Pesan struct {
Status bool `json:"status" bson:"status"`
Message string `json:"message" bson:"message"`
Data interface{} `json:"data,omitempty" bson:"data,omitempty"`
Token string `json:"token,omitempty" bson:"token,omitempty"`
}
type Geometry struct {
Coordinates interface{} `json:"coordinates" bson:"coordinates"`
Type string `json:"type" bson:"type"`
}
type GeoJson struct {
Type string `json:"type" bson:"type"`
Properties Properties `json:"properties" bson:"properties"`
Geometry Geometry `json:"geometry" bson:"geometry"`
}
type FullGeoJson struct {
ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
Type string `json:"type" bson:"type"`
Properties Properties `json:"properties" bson:"properties"`
Geometry Geometry `json:"geometry" bson:"geometry"`
}
type Properties struct {
Name string `json:"name" bson:"name"`
}
type GeoJsonPoint struct {
Type string `json:"type" bson:"type"`
Properties Properties `json:"properties" bson:"properties"`
Geometry struct {
Coordinates []float64 `json:"coordinates" bson:"coordinates"`
Type string `json:"type" bson:"type"`
} `json:"geometry" bson:"geometry"`
}
type GeoJsonLineString struct {
Type string `json:"type" bson:"type"`
Properties Properties `json:"properties" bson:"properties"`
Geometry struct {
Coordinates [][]float64 `json:"coordinates" bson:"coordinates"`
Type string `json:"type" bson:"type"`
} `json:"geometry" bson:"geometry"`
}
type GeoJsonPolygon struct {
Type string `json:"type" bson:"type"`
Properties Properties `json:"properties" bson:"properties"`
Geometry struct {
Coordinates [][][]float64 `json:"coordinates" bson:"coordinates"`
Type string `json:"type,omitempty" bson:"type,omitempty"`
} `json:"geometry" bson:"geometry"`
}
type Point struct {
Coordinates []float64 `json:"coordinates" bson:"coordinates"`
Max int64 `json:"max,omitempty" bson:"max,omitempty"`
Min int64 `json:"min,omitempty" bson:"min,omitempty"`
Radius float64 `json:"radius,omitempty" bson:"radius,omitempty"`
}
type Polyline struct {
Coordinates [][]float64 `json:"coordinates" bson:"coordinates"`
}
type Polygon struct {
Coordinates [][][]float64 `json:"coordinates" bson:"coordinates"`
}
type LongLat struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
}
type Asdasd struct {
Coordinates interface{} `json:"coordinates" bson:"coordinates"`
Max int64 `json:"max,omitempty" bson:"max,omitempty"`
Min int64 `json:"min,omitempty" bson:"min,omitempty"`
Radius float64 `json:"radius,omitempty" bson:"radius,omitempty"`
Type string `json:"type,omitempty" bson:"type,omitempty"`
}