From 0ad98fe9921deccd6b5247522a4a3af479449d09 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 14 Apr 2024 22:45:50 +0200 Subject: [PATCH] clean up and added pixel endpoint --- types.go | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/types.go b/types.go index c8d4224..762ec5c 100644 --- a/types.go +++ b/types.go @@ -9,24 +9,31 @@ type Endpoint string const ( RECTANGLE Endpoint = "rectangle" UPDATE Endpoint = "update" + PIXEL Endpoint = "pixel" COLOR Endpoint = "color" ) +type Rectangle struct { + X int `json:"x"` + Y int `json:"y"` + W uint `json:"w"` + H uint `json:"h"` + Endpoint Endpoint `json:"endpoint"` +} + type Update struct { Endpoint Endpoint `json:"endpoint"` } +type Pixel struct { + X int `json:"x"` + Y int `json:"y"` + Endpoint Endpoint `json:"endpoint"` +} + type Color struct { R uint8 `json:"r"` G uint8 `json:"g"` B uint8 `json:"b"` Endpoint Endpoint `json:"endpoint"` } - -type Rectangle struct { - X int `json:"x"` - Y int `json:"y"` - W uint `json:"w"` - H uint `json:"h"` - Endpoint Endpoint `json:"endpoint"` -}