Skip to content

Commit

Permalink
Adding comments
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Dec 23, 2023
1 parent 9980185 commit 93f0b64
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
8 changes: 6 additions & 2 deletions common/transporter/action/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ package action
type Action string

const (
Start Action = "start"
// Start is the action sent to the recorder and forwarder when a stream starts
Start Action = "start"
// Status is the action sent to the recorder and forwarder when the ffmpeg logs are required
Status Action = "status"
Stop Action = "stop"
// Stop is the action sent to the recorder and forwarder when the server is meant to be stopped
Stop Action = "stop"
)

// String returns the string of the action
func (a Action) String() string {
return string(a)
}
5 changes: 4 additions & 1 deletion common/transporter/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ package server
type Server string

const (
// Forwarder is the type denoted for the forwarder server
Forwarder Server = "forwarder"
Recorder Server = "recorder"
// Recorder is the type denoted for the recorder server
Recorder Server = "recorder"
)

// String returns the string of the server
func (s Server) String() string {
return string(s)
}
8 changes: 6 additions & 2 deletions common/wsMessages/special/specialWsMessages.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ package wsMessages
type SpecialWSMessage string

var (
// Acknowledged is the special web socket message sent during the connection phase
Acknowledged SpecialWSMessage = "ACKNOWLEDGED"
Ping SpecialWSMessage = "PING"
Pong SpecialWSMessage = "PONG"
// Ping is sent from the server to the forwarder and recorder to validate the connection
Ping SpecialWSMessage = "PING"
// Pong is sent from the forwarder or recorder to the server to validate the connection in response to the Ping
Pong SpecialWSMessage = "PONG"
)

// String returns the string of the special websocket message
func (s SpecialWSMessage) String() string {
return string(s)
}
5 changes: 4 additions & 1 deletion common/wsMessages/wsMessages.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ package wsMessages
type WSMessage string

var (
Okay WSMessage = "OKAY"
// Okay is the response sent back to the server when everything was okay
Okay WSMessage = "OKAY"
// Error is the response sent back to the server when something has gone wrong
Error WSMessage = "ERROR"
)

// String returns the string of the web socket
func (w WSMessage) String() string {
return string(w)
}

0 comments on commit 93f0b64

Please sign in to comment.