diff options
Diffstat (limited to 'pkg/handler/handler.go')
-rw-r--r-- | pkg/handler/handler.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 5ba3966..15eb42d 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -1,7 +1,15 @@ package handler -import "github.com/uptrace/bun" +import "github.com/labstack/echo/v4" -type Handler struct { - DB *bun.DB +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)) + } } |