File tree Expand file tree Collapse file tree 5 files changed +13
-73
lines changed Expand file tree Collapse file tree 5 files changed +13
-73
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,12 @@ import (
7
7
)
8
8
9
9
type Vector2 struct {
10
- X float64 `json:"x"`
11
- Y float64 `json:"y"`
10
+ X float64
11
+ Y float64
12
+ }
13
+
14
+ func (v Vector2 ) MarshalJSON () ([]byte , error ) {
15
+ return json .Marshal ([]float64 {v .X , v .Y })
12
16
}
13
17
14
18
type Vector2Wrapper struct {
@@ -29,9 +33,13 @@ func (v *Vector2Wrapper) UnmarshalJSON(data []byte) error {
29
33
}
30
34
31
35
type Vector3 struct {
32
- X float64 `json:"x"`
33
- Y float64 `json:"y"`
34
- Z float64 `json:"z"`
36
+ X float64
37
+ Y float64
38
+ Z float64
39
+ }
40
+
41
+ func (v Vector3 ) MarshalJSON () ([]byte , error ) {
42
+ return json .Marshal ([]float64 {v .X , v .Y , v .Z })
35
43
}
36
44
37
45
type Vector3Wrapper struct {
@@ -52,24 +60,8 @@ func (v *Vector3Wrapper) UnmarshalJSON(data []byte) error {
52
60
}
53
61
54
62
type Color string
55
-
56
63
type MetricImperialUnit string
57
-
58
- const (
59
- MetricMM MetricImperialUnit = "mm"
60
- MetricCM MetricImperialUnit = "cm"
61
- MetricM MetricImperialUnit = "m"
62
- MetricF MetricImperialUnit = "f"
63
- )
64
-
65
64
type FloorMetric string
66
-
67
- const (
68
- FloorM FloorMetric = "m"
69
- FloorT FloorMetric = "t"
70
- FloorF FloorMetric = "f"
71
- )
72
-
73
65
type Slug string
74
66
75
67
type Header struct {
Original file line number Diff line number Diff line change @@ -4,11 +4,6 @@ import "encoding/json"
4
4
5
5
type Temperature string
6
6
7
- const (
8
- COLD Temperature = "cold"
9
- WARM Temperature = "warm"
10
- )
11
-
12
7
type Corridor struct {
13
8
Header
14
9
Content string `json:"content"`
Original file line number Diff line number Diff line change @@ -4,13 +4,6 @@ import "encoding/json"
4
4
5
5
type DeviceOrientation string
6
6
7
- const (
8
- DeviceFront DeviceOrientation = "front"
9
- DeviceRear DeviceOrientation = "rear"
10
- DeviceFrontflipped DeviceOrientation = "frontflipped"
11
- DeviceRearflipped DeviceOrientation = "rearflipped"
12
- )
13
-
14
7
type DeviceTemplate = RackTemplate
15
8
16
9
type Device struct {
Original file line number Diff line number Diff line change @@ -6,43 +6,10 @@ import (
6
6
)
7
7
8
8
type RackOrientation string
9
-
10
- const (
11
- RackFront RackOrientation = "front"
12
- RackRear RackOrientation = "rear"
13
- RackLeft RackOrientation = "left"
14
- RackRight RackOrientation = "right"
15
- )
16
-
17
9
type RackUnit string
18
-
19
- const (
20
- RackMM RackUnit = "mm"
21
- RackCM RackUnit = "cm"
22
- RackM RackUnit = "m"
23
- RackU RackUnit = "u"
24
- RackOU RackUnit = "ou"
25
- RackF RackUnit = "f"
26
- )
27
-
28
10
type LabelPosition string
29
-
30
- const (
31
- LabelFront LabelPosition = "front"
32
- LabelRear LabelPosition = "rear"
33
- LabelFrontrear LabelPosition = "frontrear"
34
- LabelTop LabelPosition = "top"
35
- LabelRight LabelPosition = "right"
36
- LabelLeft LabelPosition = "left"
37
- )
38
-
39
11
type ComponentOrientation string
40
12
41
- const (
42
- ComponentHorizontal ComponentOrientation = "horizontal"
43
- ComponentVertical ComponentOrientation = "vertical"
44
- )
45
-
46
13
type Component struct {
47
14
Factor string `json:"factor,omitempty"`
48
15
Color * Color `json:"color,omitempty"`
Original file line number Diff line number Diff line change @@ -4,13 +4,6 @@ import "encoding/json"
4
4
5
5
type SiteOrientation string
6
6
7
- const (
8
- EN SiteOrientation = "EN"
9
- NW SiteOrientation = "NW"
10
- WS SiteOrientation = "WS"
11
- SE SiteOrientation = "SE"
12
- )
13
-
14
7
type Site struct {
15
8
Header
16
9
Orientation * SiteOrientation `json:"orientation,omitempty"`
You can’t perform that action at this time.
0 commit comments