live

package
v0.0.0-...-34a2968 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

func (*GrafanaLive) Publish

func (g *GrafanaLive) Publish(channel string, data []byte) error

Publish sends the data to the channel without checking permissions etc

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

OnSubscribe for now allows anyone to subscribe to any dashboard

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL