aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/feed/handler.go
blob: 868e47786b6ccb024ae422f3ba4baf12de1de32c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
}