Matrix/types.go

45 lines
877 B
Go
Raw Normal View History

2024-04-12 12:13:21 +00:00
package main
type Response struct {
Success bool `json:"success"`
}
type Endpoint string
const (
RECTANGLE Endpoint = "rectangle"
UPDATE Endpoint = "update"
2024-04-14 20:45:50 +00:00
PIXEL Endpoint = "pixel"
2024-04-12 12:13:21 +00:00
COLOR Endpoint = "color"
2024-04-17 06:09:37 +00:00
CLEAR Endpoint = "clear"
2024-04-12 12:13:21 +00:00
)
2024-04-14 20:45:50 +00:00
type Rectangle struct {
X int `json:"x"`
Y int `json:"y"`
W uint `json:"w"`
H uint `json:"h"`
2024-04-12 12:13:21 +00:00
Endpoint Endpoint `json:"endpoint"`
}
2024-04-17 06:09:37 +00:00
type Clear struct {
Endpoint Endpoint `json:"endpoint"`
}
2024-04-14 20:45:50 +00:00
type Update struct {
2024-04-12 12:13:21 +00:00
Endpoint Endpoint `json:"endpoint"`
}
2024-04-14 20:45:50 +00:00
type Pixel struct {
2024-04-12 12:13:21 +00:00
X int `json:"x"`
Y int `json:"y"`
2024-04-14 20:45:50 +00:00
Endpoint Endpoint `json:"endpoint"`
}
type Color struct {
R uint8 `json:"r"`
G uint8 `json:"g"`
B uint8 `json:"b"`
2024-04-12 12:13:21 +00:00
Endpoint Endpoint `json:"endpoint"`
}