Live: http publish, refactor live interfaces (#32317)

This commit is contained in:
Alexander Emelin
2021-03-30 13:23:29 +03:00
committed by GitHub
parent 84ea3a73c0
commit da05b7a07b
10 changed files with 191 additions and 95 deletions
+4
View File
@@ -397,6 +397,10 @@ func (hs *HTTPServer) registerRoutes() {
annotationsRoute.Post("/graphite", reqEditorRole, bind(dtos.PostGraphiteAnnotationsCmd{}), routing.Wrap(PostGraphiteAnnotation))
})
if hs.Live.IsEnabled() {
apiRoute.Post("/live/publish", bind(dtos.LivePublishCmd{}), routing.Wrap(hs.Live.HandleHTTPPublish))
}
// short urls
apiRoute.Post("/short-urls", bind(dtos.CreateShortURLCmd{}), routing.Wrap(hs.createShortURL))
}, reqSignedIn)
+11
View File
@@ -0,0 +1,11 @@
package dtos
import "encoding/json"
type LivePublishCmd struct {
Channel string `json:"channel"`
Data json.RawMessage `json:"data,omitempty"`
}
type LivePublishResponse struct {
}