fix: move shit to parent folder
This commit is contained in:
parent
7a5d8edfc6
commit
7d869ea36d
6 changed files with 3 additions and 0 deletions
24
internal/types/types.go
Normal file
24
internal/types/types.go
Normal 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))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue