Documentation ¶
Index ¶
- type BroadcastRunner
- func (b *BroadcastRunner) GetHandlerForPath(path string) (models.ChannelHandler, error)
- func (b *BroadcastRunner) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) (centrifuge.PublishReply, error)
- func (b *BroadcastRunner) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) (centrifuge.SubscribeReply, error)
- type DashboardHandler
- func (h *DashboardHandler) DashboardDeleted(uid string, userID int64) error
- func (h *DashboardHandler) DashboardSaved(uid string, userID int64) error
- func (h *DashboardHandler) GetHandlerForPath(path string) (models.ChannelHandler, error)
- func (h *DashboardHandler) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) (centrifuge.PublishReply, error)
- func (h *DashboardHandler) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) (centrifuge.SubscribeReply, error)
- type MeasurementsRunner
- func (m *MeasurementsRunner) GetHandlerForPath(path string) (models.ChannelHandler, error)
- func (m *MeasurementsRunner) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) (centrifuge.PublishReply, error)
- func (m *MeasurementsRunner) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) (centrifuge.SubscribeReply, error)
- type TestDataSupplier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastRunner ¶
type BroadcastRunner struct{}
BroadcastRunner will simply broadcast all events to `grafana/broadcast/*` channels This assumes that data is a JSON object
func (*BroadcastRunner) GetHandlerForPath ¶
func (b *BroadcastRunner) GetHandlerForPath(path string) (models.ChannelHandler, error)
GetHandlerForPath called on init
func (*BroadcastRunner) OnPublish ¶
func (b *BroadcastRunner) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) (centrifuge.PublishReply, error)
OnPublish is called when a client wants to broadcast on the websocket
func (*BroadcastRunner) OnSubscribe ¶
func (b *BroadcastRunner) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) (centrifuge.SubscribeReply, error)
OnSubscribe will let anyone connect to the path
type DashboardHandler ¶
type DashboardHandler struct {
Publisher models.ChannelPublisher
}
DashboardHandler manages all the `grafana/dashboard/*` channels
func (*DashboardHandler) DashboardDeleted ¶
func (h *DashboardHandler) DashboardDeleted(uid string, userID int64) error
DashboardDeleted will broadcast to all connected dashboards
func (*DashboardHandler) DashboardSaved ¶
func (h *DashboardHandler) DashboardSaved(uid string, userID int64) error
DashboardSaved will broadcast to all connected dashboards
func (*DashboardHandler) GetHandlerForPath ¶
func (h *DashboardHandler) GetHandlerForPath(path string) (models.ChannelHandler, error)
GetHandlerForPath called on init
func (*DashboardHandler) OnPublish ¶
func (h *DashboardHandler) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) (centrifuge.PublishReply, error)
OnPublish is called when someone begins to edit a dashoard
func (*DashboardHandler) OnSubscribe ¶
func (h *DashboardHandler) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) (centrifuge.SubscribeReply, error)
OnSubscribe for now allows anyone to subscribe to any dashboard
type MeasurementsRunner ¶
type MeasurementsRunner struct { }
MeasurementsRunner will simply broadcast all events to `grafana/broadcast/*` channels. This makes no assumptions about the shape of the data and will broadcast it to anyone listening
func (*MeasurementsRunner) GetHandlerForPath ¶
func (m *MeasurementsRunner) GetHandlerForPath(path string) (models.ChannelHandler, error)
GetHandlerForPath gets the handler for a path. It's called on init.
func (*MeasurementsRunner) OnPublish ¶
func (m *MeasurementsRunner) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) (centrifuge.PublishReply, error)
OnPublish is called when a client wants to broadcast on the websocket Currently this sends measurements over websocket -- should be replaced with the HTTP interface
func (*MeasurementsRunner) OnSubscribe ¶
func (m *MeasurementsRunner) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) (centrifuge.SubscribeReply, error)
OnSubscribe will let anyone connect to the path
type TestDataSupplier ¶
type TestDataSupplier struct {
Publisher models.ChannelPublisher
}
TestDataSupplier manages all the `grafana/testdata/*` channels.
func (*TestDataSupplier) GetHandlerForPath ¶
func (s *TestDataSupplier) GetHandlerForPath(path string) (models.ChannelHandler, error)
GetHandlerForPath gets the channel handler for a path. Called on init.