summaryrefslogtreecommitdiff
path: root/pkg/apiv2/api.go
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-29 01:21:05 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-29 01:21:05 +0300
commitfd4e0c3112d69061d495dfcf79f6ef62e3c6d5e6 (patch)
treefa55d6e879e3c6d85601d5c2486837f323ffd81d /pkg/apiv2/api.go
parentb26bd10926447ed59cbf263aef087bb7c04f35eb (diff)
Начальный веб клиентHEADmaster
Diffstat (limited to 'pkg/apiv2/api.go')
-rw-r--r--pkg/apiv2/api.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/pkg/apiv2/api.go b/pkg/apiv2/api.go
new file mode 100644
index 0000000..8fbd759
--- /dev/null
+++ b/pkg/apiv2/api.go
@@ -0,0 +1,27 @@
+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"))
+}