Upgrade Echo framework from v4 to v5

This commit is contained in:
2026-05-20 21:56:06 +02:00
parent 12f18ba12c
commit 2cff8d16d7
7 changed files with 53 additions and 51 deletions
+5 -5
View File
@@ -5,7 +5,7 @@ import (
"music-server/internal/backend"
"net/http"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v5"
)
type SyncHandler struct {
@@ -23,7 +23,7 @@ func NewSyncHandler() *SyncHandler {
// @Produce json
// @Success 200 {object} map[string]interface{}
// @Router /sync/progress [get]
func (s *SyncHandler) SyncProgress(ctx echo.Context) error {
func (s *SyncHandler) SyncProgress(ctx *echo.Context) error {
if backend.Syncing {
log.Println("Getting progress")
response := backend.SyncProgress()
@@ -43,7 +43,7 @@ func (s *SyncHandler) SyncProgress(ctx echo.Context) error {
// @Success 200 {string} string "Start syncing games"
// @Failure 423 {string} string "Syncing is in progress"
// @Router /sync [get]
func (s *SyncHandler) SyncGamesNewOnlyChanges(ctx echo.Context) error {
func (s *SyncHandler) SyncGamesNewOnlyChanges(ctx *echo.Context) error {
if backend.Syncing {
log.Println("Syncing is in progress")
return ctx.JSON(http.StatusLocked, "Syncing is in progress")
@@ -62,7 +62,7 @@ func (s *SyncHandler) SyncGamesNewOnlyChanges(ctx echo.Context) error {
// @Success 200 {string} string "Start syncing games full"
// @Failure 423 {string} string "Syncing is in progress"
// @Router /sync/full [get]
func (s *SyncHandler) SyncGamesNewFull(ctx echo.Context) error {
func (s *SyncHandler) SyncGamesNewFull(ctx *echo.Context) error {
if backend.Syncing {
log.Println("Syncing is in progress")
return ctx.JSON(http.StatusLocked, "Syncing is in progress")
@@ -81,7 +81,7 @@ func (s *SyncHandler) SyncGamesNewFull(ctx echo.Context) error {
// @Success 200 {string} string "Games and songs are deleted from the database"
// @Failure 423 {string} string "Syncing is in progress"
// @Router /sync/reset [get]
func (s *SyncHandler) ResetGames(ctx echo.Context) error {
func (s *SyncHandler) ResetGames(ctx *echo.Context) error {
if backend.Syncing {
log.Println("Syncing is in progress")
return ctx.JSON(http.StatusLocked, "Syncing is in progress")