From 0f6fec9d8d2b2de8170c5792184f956401d234a5 Mon Sep 17 00:00:00 2001 From: Kostas Drakontidis Date: Fri, 25 Jul 2025 16:20:12 +0300 Subject: [PATCH] Added messages --- client/backend/config.yml | 9 +++++++++ client/backend/types.go | 19 +++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/client/backend/config.yml b/client/backend/config.yml index fc3411c..18bad8a 100644 --- a/client/backend/config.yml +++ b/client/backend/config.yml @@ -21,6 +21,9 @@ messages: CLOSE: SUCCESS: "Disconnected from WebSocket.\n" ERROR: "Could not close WebSocket connection.\n %v\n\n" + CLOSE_MESSAGE: + SUCCESS: "Sent close message to WebSocket.\n" + ERROR: "Could not send close message to WebSocket.\n %v\n\n" REGISTER: SUCCESS: "Registered to WebSocket.\n" ERROR: "Could not send register message.\n %v\n\n" @@ -47,6 +50,9 @@ messages: NEW: SUCCESS: "Created WebRTC instance.\n" ERROR: "Could not create WebRTC instance.\n %v\n\n" + CLOSE: + SUCCESS: "Closed P2P connection.\n" + ERROR: "Could not close P2P connection.\n %v\n\n" OFFER: SUCCESS: "Created offer.\n" ERROR: "Could not create offer.\n %v\n\n" @@ -78,6 +84,9 @@ messages: WRITE: SUCCESS: "Wrote HTTP response.\n" ERROR: "Could not write HTTP response.\n %v\n\n" + URL_PARSE: + SUCCESS: "Updated Location header port.\n" + ERROR: "Could not update Location header port.\n %v\n\n" GOB: ENCODE: SUCCESS: "Encoded struct to buffer.\n" diff --git a/client/backend/types.go b/client/backend/types.go index 15e59dc..e884a82 100644 --- a/client/backend/types.go +++ b/client/backend/types.go @@ -79,11 +79,12 @@ type Config struct { START string `yaml:"START"` MISSING_PORT string `yaml:"MISSING_PORT"` WS struct { - CONNECT Message `yaml:"CONNECT"` - CLOSE Message `yaml:"CLOSE"` - REGISTER Message `yaml:"REGISTER"` - READ Message `yaml:"READ"` - WRITE Message `yaml:"WRITE"` + CONNECT Message `yaml:"CONNECT"` + CLOSE Message `yaml:"CLOSE"` + CLOSE_MESSAGE Message `yaml:"CLOSE_MESSAGE"` + REGISTER Message `yaml:"REGISTER"` + READ Message `yaml:"READ"` + WRITE Message `yaml:"WRITE"` } `yaml:"WS"` JSON struct { MARSHAL Message `yaml:"MARSHAL"` @@ -93,6 +94,7 @@ type Config struct { } `yaml:"JSON"` WEBRTC struct { NEW Message `yaml:"NEW"` + CLOSE Message `yaml:"CLOSE"` OFFER Message `yaml:"OFFER"` LOCAL_DESCRIPTION Message `yaml:"LOCAL_DESCRIPTION"` REMOTE_DESCRIPTION Message `yaml:"REMOTE_DESCRIPTION"` @@ -104,9 +106,10 @@ type Config struct { ON_MESSAGE string `yaml:"ON_MESSAGE"` } `yaml:"WEBRTC"` HTTP struct { - LISTEN Message `yaml:"LISTEN"` - READ Message `yaml:"READ"` - WRITE Message `yaml:"WRITE"` + LISTEN Message `yaml:"LISTEN"` + READ Message `yaml:"READ"` + WRITE Message `yaml:"WRITE"` + URL_PARSE Message `yaml:"URL_PARSE"` } `yaml:"HTTP"` GOB struct { ENCODE Message `yaml:"ENCODE"`