Moved around more code. Implemented more sqlc. Added support to generate swagger.

Added support for profiling. Removed the pkg module altogether.
Everything except old sync is now using code generated by sqlc.
This commit is contained in:
2025-01-15 16:04:14 +01:00
parent db8214cb02
commit d653463f58
43 changed files with 947 additions and 1133 deletions

View File

@@ -3,9 +3,10 @@ package server
import (
"log"
"music-server/internal/backend"
"music-server/internal/database"
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/v4"
)
type SyncHandler struct {
@@ -16,13 +17,13 @@ func NewSyncHandler() *SyncHandler {
}
func (s *SyncHandler) SyncGames(ctx echo.Context) error {
backend.SyncGames()
database.SyncGames()
backend.Reset()
return ctx.JSON(http.StatusOK, "Games are synced")
}
func (s *SyncHandler) SyncGamesQuick(ctx echo.Context) error {
backend.SyncGamesQuick()
database.SyncGamesQuick()
backend.Reset()
return ctx.JSON(http.StatusOK, "Games are synced")
}