aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/feed/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/handler/feed/handler.go')
-rw-r--r--pkg/handler/feed/handler.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/handler/feed/handler.go b/pkg/handler/feed/handler.go
new file mode 100644
index 0000000..868e477
--- /dev/null
+++ b/pkg/handler/feed/handler.go
@@ -0,0 +1,21 @@
+package feed
+
+import (
+ "github.com/labstack/echo/v4"
+ "github.com/uptrace/bun"
+ "sh.org.ru/pkg/config"
+)
+
+type Handler struct {
+ db *bun.DB
+ cfg *config.Config
+}
+
+// NewHandler returns new Handler.
+func NewHandler(db *bun.DB, cfg *config.Config) *Handler {
+ return &Handler{db: db, cfg: cfg}
+}
+
+func (h *Handler) Register(g *echo.Group) {
+ g.GET("/:type", h.Feed)
+}