fix: move shit to parent folder

This commit is contained in:
hexlocation 2025-05-05 12:22:58 +02:00
parent 7a5d8edfc6
commit 7d869ea36d
6 changed files with 3 additions and 0 deletions

24
internal/types/types.go Normal file
View file

@ -0,0 +1,24 @@
package types
import (
"github.com/gin-gonic/gin"
)
type Route struct {
Path string
Method string
Exec func(cfg *StereoConfig) gin.HandlerFunc
}
type StereoConfig struct {
Router *gin.Engine
ImagePath string
}
func RegisterRoutes(groupName string, routes []Route, cfg *StereoConfig) {
group := cfg.Router.Group(groupName)
for _, route := range routes {
group.Handle(route.Method, route.Path, route.Exec(cfg))
}
}