feat: add rest routes to take the control of flink jobs

This commit is contained in:
2025-01-09 00:22:53 +03:30
parent 4dd82c6380
commit 0df874b222
14 changed files with 1019 additions and 12 deletions

28
internal/rest/base.go Normal file
View File

@@ -0,0 +1,28 @@
package rest
import (
"fmt"
"log"
"github.com/danielgtaylor/huma/v2"
humaFiber "github.com/danielgtaylor/huma/v2/adapters/humafiber"
"github.com/gofiber/fiber/v2"
)
func Init() {
app := fiber.New()
config := huma.DefaultConfig("Go API", "1.0.0")
config.Servers = []*huma.Server{{}}
config.Components.SecuritySchemes = map[string]*huma.SecurityScheme{
"auth": {
Type: "http",
Scheme: "bearer",
BearerFormat: "JWT",
},
}
api := humaFiber.New(app, config)
initRouter(api)
log.Fatal(app.Listen(fmt.Sprintf(":%s", "3000")))
}