new proxy implementation with Gin framework
- Created a new proxy structure under NewProxy/ using the Gin web framework. - Added main entry point (main.go) to register and run routes. - Implemented new route handlers for: > Status — monitors active downloads and total data transferred. > Forward — handles proxy forwarding logic. > Builds — manages build-related requests.
This commit is contained in:
16
NewProxy/routes/builds.go
Normal file
16
NewProxy/routes/builds.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin" //hellow gin again ;)
|
||||
"newproxy/utils"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func RegisterBuildsRoute(r *gin.Engine) {
|
||||
r.GET("/client/builds.json", buildsHandler)
|
||||
}
|
||||
|
||||
func buildsHandler(c *gin.Context) {
|
||||
utils.FetchLatestRelease()
|
||||
c.JSON(http.StatusOK, utils.LatestRelease)
|
||||
}
|
||||
Reference in New Issue
Block a user