22 lines
368 B
Go
22 lines
368 B
Go
|
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)
|
||
|
}
|