Documentation ¶
Index ¶
- type ChannelIdentifier
- type CoreGrafanaScope
- type GrafanaLive
- type PluginHandler
- func (g *PluginHandler) GetChannelOptions(id string) centrifuge.ChannelOptions
- func (g *PluginHandler) GetHandlerForPath(path string) (models.ChannelHandler, error)
- func (g *PluginHandler) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) ([]byte, error)
- func (g *PluginHandler) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelIdentifier ¶
type ChannelIdentifier struct { Scope string // grafana, ds, or plugin Namespace string // feature, id, or name Path string // path within the channel handler }
ChannelIdentifier is the channel id split by parts
func ParseChannelIdentifier ¶
func ParseChannelIdentifier(id string) (ChannelIdentifier, error)
ParseChannelIdentifier parses the parts from a channel id:
${scope} / ${namespace} / ${path}
type CoreGrafanaScope ¶
type CoreGrafanaScope struct { Features map[string]models.ChannelHandlerProvider // The generic service to advertise dashboard changes Dashboards models.DashboardActivityChannel }
CoreGrafanaScope list of core features
type GrafanaLive ¶
type GrafanaLive struct { // The websocket handler WebsocketHandler interface{} // The core internal features GrafanaScope CoreGrafanaScope // contains filtered or unexported fields }
GrafanaLive pretends to be the server
func InitializeBroker ¶
func InitializeBroker() (*GrafanaLive, error)
InitializeBroker initializes the broker and starts listening for requests.
func (*GrafanaLive) GetChannelHandler ¶
func (g *GrafanaLive) GetChannelHandler(channel string) (models.ChannelHandler, error)
GetChannelHandler gives threadsafe access to the channel
type PluginHandler ¶
type PluginHandler struct {
Plugin *plugins.PluginBase
}
PluginHandler manages all the `grafana/dashboard/*` channels
func (*PluginHandler) GetChannelOptions ¶
func (g *PluginHandler) GetChannelOptions(id string) centrifuge.ChannelOptions
GetChannelOptions called fast and often
func (*PluginHandler) GetHandlerForPath ¶
func (g *PluginHandler) GetHandlerForPath(path string) (models.ChannelHandler, error)
GetHandlerForPath called on init
func (*PluginHandler) OnPublish ¶
func (g *PluginHandler) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) ([]byte, error)
OnPublish called when an event is received from the websocket
func (*PluginHandler) OnSubscribe ¶
func (g *PluginHandler) OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) error
OnSubscribe for now allows anyone to subscribe to any dashboard
Click to show internal directories.
Click to hide internal directories.