-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobject-type.go
34 lines (30 loc) · 1.08 KB
/
object-type.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
package fptf
// describes, that type of json object it is. set by marshal
type objectType string
const (
objectTypeLocation objectType = "location"
objectTypeStation objectType = "station"
objectTypeStop objectType = "stop"
objectTypeRegion objectType = "region"
objectTypeLine objectType = "line"
objectTypeRoute objectType = "route"
objectTypeSchedule objectType = "schedule"
objectTypeOperator objectType = "operator"
objectTypeStopover objectType = "stopover"
objectTypeJourney objectType = "journey"
)
type Typed struct {
Type objectType `json:"type,omitempty" bson:"type,omitempty"`
}
var (
typedLocation = Typed{Type: objectTypeLocation}
typedStation = Typed{Type: objectTypeStation}
typedStop = Typed{Type: objectTypeStop}
typedRegion = Typed{Type: objectTypeRegion}
typedLine = Typed{Type: objectTypeLine}
typedRoute = Typed{Type: objectTypeRoute}
typedSchedule = Typed{Type: objectTypeSchedule}
typedOperator = Typed{Type: objectTypeOperator}
typedStopover = Typed{Type: objectTypeStopover}
typedJourney = Typed{Type: objectTypeJourney}
)