add docstrings to go code

This commit is contained in:
XenGi 2024-07-15 10:51:53 +02:00
parent 1705de7391
commit 5474934cea
Signed by: xengi
SSH key fingerprint: SHA256:FGp51kRvGOcWnTHiOI39ImwVO4A3fpvR30nPX3LpV7g

View file

@ -16,6 +16,7 @@ import (
"strings" "strings"
) )
// Config holds the configuration for the mpd connection and for the web server.
type Config struct { type Config struct {
MPD struct { MPD struct {
Hostname string `ini:"hostname"` Hostname string `ini:"hostname"`
@ -112,6 +113,7 @@ func main() {
} }
} }
// wsServe handles websocket connections.
func wsServe(c echo.Context) error { func wsServe(c echo.Context) error {
websocket.Handler(func(ws *websocket.Conn) { websocket.Handler(func(ws *websocket.Conn) {
defer ws.Close() defer ws.Close()
@ -182,6 +184,7 @@ func wsServe(c echo.Context) error {
return nil return nil
} }
// downloadTrack tries to download a given URL and saves the song to the database.
func downloadTrack(c echo.Context) error { func downloadTrack(c echo.Context) error {
// yt-dlp \ // yt-dlp \
// --no-wait-for-video \ // --no-wait-for-video \