doc: add and improve comments

This commit is contained in:
Sebastian Mark 2024-10-30 11:03:18 +01:00
parent 6187122b81
commit f19ab81dc8
11 changed files with 31 additions and 8 deletions

View file

@ -8,6 +8,7 @@ import (
GoTomato "git.smsvc.net/pomodoro/GoTomato/pkg/models"
)
// Sends to ClientCommand to the clients websocket
func (c Client) sendClientCommand(msg GoTomato.ClientCommand) {
messageBytes, err := json.Marshal(msg)
if err != nil {
@ -22,6 +23,7 @@ func (c Client) sendClientCommand(msg GoTomato.ClientCommand) {
}
}
// Sends the passed command to the server
func (c Client) SendCmd(cmd string) {
message := GoTomato.ClientCommand{
Command: cmd,
@ -31,6 +33,7 @@ func (c Client) SendCmd(cmd string) {
c.sendClientCommand(message)
}
// Sends the new PomodoroConfig to the server
func (c Client) SendSettingsUpdate(settings GoTomato.PomodoroConfig) {
message := GoTomato.ClientCommand{
Command: "updateSettings",