forked from abdullahselek/go-here
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enums.go
118 lines (108 loc) · 2.48 KB
/
enums.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
package here
// Enum a kind of alias for int values.
type Enum int
type routeModeList struct {
Fastest Enum
Car Enum
TrafficDisabled Enum
Enabled Enum
Pedestrian Enum
PublicTransport Enum
Truck Enum
TrafficDefault Enum
Bicycle Enum
}
// RouteMode for public use.
var RouteMode = &routeModeList{
Fastest: 0,
Car: 1,
TrafficDisabled: 2,
Enabled: 3,
Pedestrian: 4,
PublicTransport: 5,
Truck: 6,
TrafficDefault: 7,
Bicycle: 8,
}
// ValueOfRouteMode returns value for RouteMode.
func (mode Enum) ValueOfRouteMode() string {
modes := [...]string{
"fastest",
"car",
"traffic:disabled",
"enabled",
"pedestrian",
"publicTransport",
"truck",
"traffic:default",
"bicycle",
}
if mode < RouteMode.Fastest || mode > RouteMode.TrafficDefault {
return "Unknown"
}
return modes[mode]
}
type reverseGeocodingList struct {
RetrieveAddresses Enum
RetrieveAreas Enum
RetrieveLandmarks Enum
RetrieveAll Enum
TrackPosition Enum
}
// ReverseGeocodingMode for public use
var ReverseGeocodingMode = &reverseGeocodingList{
RetrieveAddresses: 0,
RetrieveAreas: 1,
RetrieveLandmarks: 2,
RetrieveAll: 3,
TrackPosition: 4,
}
// ValueOfReverseGeocodingMode returns value for ReverseGeocodingMode.
func (mode Enum) ValueOfReverseGeocodingMode() string {
modes := [...]string{
"retrieveAddresses",
"retrieveAreas",
"retrieveLandmarks",
"retrieveAll",
"trackPosition",
}
if mode < ReverseGeocodingMode.RetrieveAddresses || mode > ReverseGeocodingMode.TrackPosition {
return "Unknown"
}
return modes[mode]
}
type weatherProductList struct {
Observation Enum
Forecast7days Enum
Forecast7DaysSimple Enum
ForecastHourly Enum
ForecastAstronomy Enum
Alerts Enum
NwsAlerts Enum
}
// WeatherProduct for public use
var WeatherProduct = &weatherProductList{
Observation: 0,
Forecast7days: 1,
Forecast7DaysSimple: 2,
ForecastHourly: 3,
ForecastAstronomy: 4,
Alerts: 5,
NwsAlerts: 6,
}
// ValueOfWeatherProduct returns value for WeatherProduct.
func (mode Enum) ValueOfWeatherProduct() string {
modes := [...]string{
"observation",
"forecast_7days",
"forecast_7days_simple",
"forecast_hourly",
"forecast_astronomy",
"alerts",
"nws_alerts",
}
if mode < WeatherProduct.Observation || mode > WeatherProduct.NwsAlerts {
return "Unknown"
}
return modes[mode]
}