mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-26 03:51:45 +00:00
52 lines
713 B
Go
52 lines
713 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
"strconv"
|
|
|
|
"github.com/go-resty/resty/v2"
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
type Response struct {
|
|
success bool
|
|
}
|
|
|
|
type Endpoint string
|
|
|
|
const (
|
|
RECTANGLE Endpoint = "rectangle"
|
|
UPDATE Endpoint = "update"
|
|
COLOR Endpoint = "color"
|
|
)
|
|
|
|
type Update struct {
|
|
endpoint Endpoint
|
|
}
|
|
|
|
type Color struct {
|
|
R int
|
|
G int
|
|
B int
|
|
endpoint Endpoint
|
|
}
|
|
|
|
type Rectangle struct {
|
|
X int
|
|
Y int
|
|
W int
|
|
H int
|
|
endpoint Endpoint
|
|
}
|
|
|
|
func main() {
|
|
// Load .env file if it exists
|
|
err := godotenv.Load(".env")
|
|
if err != nil {
|
|
log.Fatal("Error loading .env file")
|
|
}
|
|
}
|