forked from akhilrex/hammond
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenums.go
109 lines (92 loc) · 1.33 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
package db
type FuelUnit int
const (
LITRE FuelUnit = iota
GALLON
US_GALLON
KILOGRAM
KILOWATT_HOUR
MINUTE
)
type FuelType int
const (
PETROL FuelType = iota
DIESEL
ETHANOL
CNG
ELECTRIC
LPG
)
type DistanceUnit int
const (
MILES DistanceUnit = iota
KILOMETERS
)
type Role int
const (
ADMIN Role = iota
USER
)
type AlertFrequency int
const (
ONETIME AlertFrequency = iota
RECURRING
)
type AlertType int
const (
DISTANCE AlertType = iota
TIME
BOTH
)
type EnumDetail struct {
Key string `json:"key"`
}
var FuelUnitDetails map[FuelUnit]EnumDetail = map[FuelUnit]EnumDetail{
LITRE: {
Key: "litre",
},
GALLON: {
Key: "gallon",
}, KILOGRAM: {
Key: "kilogram",
}, KILOWATT_HOUR: {
Key: "kilowatthour",
}, US_GALLON: {
Key: "usgallon",
},
MINUTE: {
Key: "minutes",
},
}
var FuelTypeDetails map[FuelType]EnumDetail = map[FuelType]EnumDetail{
PETROL: {
Key: "petrol",
},
DIESEL: {
Key: "diesel",
}, CNG: {
Key: "cng",
}, LPG: {
Key: "lpg",
}, ELECTRIC: {
Key: "electric",
}, ETHANOL: {
Key: "ethanol",
},
}
var DistanceUnitDetails map[DistanceUnit]EnumDetail = map[DistanceUnit]EnumDetail{
KILOMETERS: {
Key: "kilometers",
},
MILES: {
Key: "miles",
},
}
var RoleDetails map[Role]EnumDetail = map[Role]EnumDetail{
ADMIN: {
Key: "ADMIN",
},
USER: {
Key: "USER",
},
}