Added messages

This commit is contained in:
2025-07-25 16:20:12 +03:00
parent 6d1569ecac
commit 0f6fec9d8d
2 changed files with 20 additions and 8 deletions
+9
View File
@@ -21,6 +21,9 @@ messages:
CLOSE: CLOSE:
SUCCESS: "Disconnected from WebSocket.\n" SUCCESS: "Disconnected from WebSocket.\n"
ERROR: "Could not close WebSocket connection.\n %v\n\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: REGISTER:
SUCCESS: "Registered to WebSocket.\n" SUCCESS: "Registered to WebSocket.\n"
ERROR: "Could not send register message.\n %v\n\n" ERROR: "Could not send register message.\n %v\n\n"
@@ -47,6 +50,9 @@ messages:
NEW: NEW:
SUCCESS: "Created WebRTC instance.\n" SUCCESS: "Created WebRTC instance.\n"
ERROR: "Could not create WebRTC instance.\n %v\n\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: OFFER:
SUCCESS: "Created offer.\n" SUCCESS: "Created offer.\n"
ERROR: "Could not create offer.\n %v\n\n" ERROR: "Could not create offer.\n %v\n\n"
@@ -78,6 +84,9 @@ messages:
WRITE: WRITE:
SUCCESS: "Wrote HTTP response.\n" SUCCESS: "Wrote HTTP response.\n"
ERROR: "Could not write HTTP response.\n %v\n\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: GOB:
ENCODE: ENCODE:
SUCCESS: "Encoded struct to buffer.\n" SUCCESS: "Encoded struct to buffer.\n"
+11 -8
View File
@@ -79,11 +79,12 @@ type Config struct {
START string `yaml:"START"` START string `yaml:"START"`
MISSING_PORT string `yaml:"MISSING_PORT"` MISSING_PORT string `yaml:"MISSING_PORT"`
WS struct { WS struct {
CONNECT Message `yaml:"CONNECT"` CONNECT Message `yaml:"CONNECT"`
CLOSE Message `yaml:"CLOSE"` CLOSE Message `yaml:"CLOSE"`
REGISTER Message `yaml:"REGISTER"` CLOSE_MESSAGE Message `yaml:"CLOSE_MESSAGE"`
READ Message `yaml:"READ"` REGISTER Message `yaml:"REGISTER"`
WRITE Message `yaml:"WRITE"` READ Message `yaml:"READ"`
WRITE Message `yaml:"WRITE"`
} `yaml:"WS"` } `yaml:"WS"`
JSON struct { JSON struct {
MARSHAL Message `yaml:"MARSHAL"` MARSHAL Message `yaml:"MARSHAL"`
@@ -93,6 +94,7 @@ type Config struct {
} `yaml:"JSON"` } `yaml:"JSON"`
WEBRTC struct { WEBRTC struct {
NEW Message `yaml:"NEW"` NEW Message `yaml:"NEW"`
CLOSE Message `yaml:"CLOSE"`
OFFER Message `yaml:"OFFER"` OFFER Message `yaml:"OFFER"`
LOCAL_DESCRIPTION Message `yaml:"LOCAL_DESCRIPTION"` LOCAL_DESCRIPTION Message `yaml:"LOCAL_DESCRIPTION"`
REMOTE_DESCRIPTION Message `yaml:"REMOTE_DESCRIPTION"` REMOTE_DESCRIPTION Message `yaml:"REMOTE_DESCRIPTION"`
@@ -104,9 +106,10 @@ type Config struct {
ON_MESSAGE string `yaml:"ON_MESSAGE"` ON_MESSAGE string `yaml:"ON_MESSAGE"`
} `yaml:"WEBRTC"` } `yaml:"WEBRTC"`
HTTP struct { HTTP struct {
LISTEN Message `yaml:"LISTEN"` LISTEN Message `yaml:"LISTEN"`
READ Message `yaml:"READ"` READ Message `yaml:"READ"`
WRITE Message `yaml:"WRITE"` WRITE Message `yaml:"WRITE"`
URL_PARSE Message `yaml:"URL_PARSE"`
} `yaml:"HTTP"` } `yaml:"HTTP"`
GOB struct { GOB struct {
ENCODE Message `yaml:"ENCODE"` ENCODE Message `yaml:"ENCODE"`