idecnode/pkg/apiv2/api.go

28 lines
486 B
Go
Raw Permalink Normal View History

2024-10-29 01:21:05 +03:00
package apiv2
import (
"github.com/labstack/echo/v4"
"gitrepo.ru/neonxp/idecnode/pkg/config"
"gitrepo.ru/neonxp/idecnode/pkg/idec"
)
type API struct {
config *config.Config
idec *idec.IDEC
}
func New(i *idec.IDEC, cfg *config.Config) *API {
return &API{
config: cfg,
idec: i,
}
}
func (a *API) Register(e *echo.Echo) {
func(g *echo.Group) {
g.GET("/list", a.getListHandler)
g.GET("/e", a.getEchoHandler)
g.GET("/m", a.getMessagesHandler)
}(e.Group("/api"))
}