Documentation ¶
Index ¶
- type BroadcastRunner
- func (g *BroadcastRunner) GetChannelOptions(id string) centrifuge.ChannelOptions
- func (g *BroadcastRunner) GetHandlerForPath(path string) (models.ChannelHandler, error)
- func (g *BroadcastRunner) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) ([]byte, error)
- func (g *BroadcastRunner) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) error
- type DashboardHandler
- func (g *DashboardHandler) DashboardDeleted(uid string, userID int64) error
- func (g *DashboardHandler) DashboardSaved(uid string, userID int64) error
- func (g *DashboardHandler) GetChannelOptions(id string) centrifuge.ChannelOptions
- func (g *DashboardHandler) GetHandlerForPath(path string) (models.ChannelHandler, error)
- func (g *DashboardHandler) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) ([]byte, error)
- func (g *DashboardHandler) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) 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 makes no assumptions about the shape of the data and will broadcast it to anyone listening
func (*BroadcastRunner) GetChannelOptions ¶
func (g *BroadcastRunner) GetChannelOptions(id string) centrifuge.ChannelOptions
GetChannelOptions called fast and often
func (*BroadcastRunner) GetHandlerForPath ¶
func (g *BroadcastRunner) GetHandlerForPath(path string) (models.ChannelHandler, error)
GetHandlerForPath called on init
func (*BroadcastRunner) OnPublish ¶
func (g *BroadcastRunner) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) ([]byte, error)
OnPublish called when an event is received from the websocket
func (*BroadcastRunner) OnSubscribe ¶
func (g *BroadcastRunner) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) error
OnSubscribe for now allows anyone to subscribe to any dashboard
type DashboardHandler ¶
type DashboardHandler struct {
// contains filtered or unexported fields
}
DashboardHandler manages all the `grafana/dashboard/*` channels
func CreateDashboardHandler ¶
func CreateDashboardHandler(p models.ChannelPublisher) DashboardHandler
CreateDashboardHandler Initialize a dashboard handler
func (*DashboardHandler) DashboardDeleted ¶
func (g *DashboardHandler) DashboardDeleted(uid string, userID int64) error
DashboardDeleted will broadcast to all connected dashboards
func (*DashboardHandler) DashboardSaved ¶
func (g *DashboardHandler) DashboardSaved(uid string, userID int64) error
DashboardSaved will broadcast to all connected dashboards
func (*DashboardHandler) GetChannelOptions ¶
func (g *DashboardHandler) GetChannelOptions(id string) centrifuge.ChannelOptions
GetChannelOptions called fast and often
func (*DashboardHandler) GetHandlerForPath ¶
func (g *DashboardHandler) GetHandlerForPath(path string) (models.ChannelHandler, error)
GetHandlerForPath called on init
func (*DashboardHandler) OnPublish ¶
func (g *DashboardHandler) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) ([]byte, error)
OnPublish called when an event is received from the websocket
func (*DashboardHandler) OnSubscribe ¶
func (g *DashboardHandler) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) error
OnSubscribe for now allows anyone to subscribe to any dashboard
type TestdataSupplier ¶
type TestdataSupplier struct {
// contains filtered or unexported fields
}
TestdataSupplier manages all the `grafana/testdata/*` channels
func CreateTestdataSupplier ¶
func CreateTestdataSupplier(p models.ChannelPublisher) TestdataSupplier
CreateTestdataSupplier Initialize a dashboard handler
func (*TestdataSupplier) GetHandlerForPath ¶
func (g *TestdataSupplier) GetHandlerForPath(path string) (models.ChannelHandler, error)
GetHandlerForPath called on init