shorgru/pkg/handler/handler.go

16 lines
264 B
Go
Raw Permalink Normal View History

2024-10-06 17:04:37 +03:00
package handler
import "github.com/labstack/echo/v4"
2024-10-06 17:04:37 +03:00
type Handler interface {
Register(g *echo.Group)
}
type Router map[string]Handler
func (r Router) Register(e *echo.Echo) {
for groupName, handlers := range r {
handlers.Register(e.Group(groupName))
}
2024-10-06 17:04:37 +03:00
}