#1 - Created request to check newest version of the app
All checks were successful
Build / build (push) Successful in 2m35s

#2 - Added request to download the newest version of the app
#3 - Added request to check progress during sync
#4 - Now blocking all request while sync is in progress
#5 - Implemented ants for thread pooling
#6 - Changed the sync request to now only start the sync
This commit is contained in:
2025-08-23 11:36:03 +02:00
parent 0d1c69d95e
commit 806e88adeb
26 changed files with 673 additions and 675 deletions

View File

@@ -12,10 +12,22 @@ import (
"github.com/a-h/templ"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
echoSwagger "github.com/swaggo/echo-swagger" // echo-swagger middleware
"github.com/swaggo/echo-swagger" // echo-swagger middleware
//_ "github.com/swaggo/echo-swagger/example/docs" // docs is generated by Swag CLI, you have to import it.
)
// @Title Swagger Example API
// @version 0.5
// @description This is a sample server Petstore server.
// @termsOfService http://swagger.io/terms/
// @contact.name Sebastian Olsson
// @contact.email zarnor91@gmail.com
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8080
func (s *Server) RegisterRoutes() http.Handler {
e := echo.New()
e.Use(middleware.Logger())
@@ -37,15 +49,15 @@ func (s *Server) RegisterRoutes() http.Handler {
e.Static("/", "/frontend")
swagger := http.FileServer(http.FS(web.Swagger))
e.GET("/swagger/*", echo.WrapHandler(swagger))
/*swagger := http.FileServer(http.FS(web.Swagger))
e.GET("/swagger/*", echo.WrapHandler(swagger))*/
swaggerRedirect := func(c echo.Context) error {
return c.Redirect(http.StatusMovedPermanently, "/doc/index.html")
return c.Redirect(http.StatusMovedPermanently, "/swagger/index.html")
}
e.GET("/doc", swaggerRedirect)
e.GET("/doc/", swaggerRedirect)
e.GET("/doc/*", echoSwagger.WrapHandler)
e.GET("/swagger", swaggerRedirect)
e.GET("/swagger/", swaggerRedirect)
e.GET("/swagger/*", echoSwagger.WrapHandler)
index := NewIndexHandler()
e.GET("/version", index.GetVersion)
@@ -54,12 +66,19 @@ func (s *Server) RegisterRoutes() http.Handler {
e.GET("/character", index.GetCharacter)
e.GET("/characters", index.GetCharacters)
download := NewDownloadHandler()
e.GET("/download", download.checkLatest)
e.GET("/download/list", download.listAssetsOfLatest)
e.GET("/download/windows", download.downloadLatestWindows)
e.GET("/download/linux", download.downloadLatestLinux)
sync := NewSyncHandler()
syncGroup := e.Group("/sync")
syncGroup.GET("", sync.SyncGames)
syncGroup.GET("", sync.SyncGamesNewOnlyChanges)
syncGroup.GET("/progress", sync.SyncProgress)
syncGroup.GET("/new", sync.SyncGamesNewOnlyChanges)
syncGroup.GET("/new/full", sync.SyncGamesNewFull)
syncGroup.GET("/quick", sync.SyncGamesQuick)
syncGroup.GET("/quick", sync.SyncGamesNewOnlyChanges)
syncGroup.GET("/reset", sync.ResetGames)
music := NewMusicHandler()