features

package
v0.0.0-...-34898ab Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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 `grafarg/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

OnPublish is called when a client wants to broadcast on the websocket

func (*BroadcastRunner) OnSubscribe

OnSubscribe will let anyone connect to the path

type DashboardHandler

type DashboardHandler struct {
	Publisher models.ChannelPublisher
}

DashboardHandler manages all the `grafarg/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

OnPublish is called when someone begins to edit a dashoard

func (*DashboardHandler) OnSubscribe

OnSubscribe for now allows anyone to subscribe to any dashboard

type MeasurementsRunner

type MeasurementsRunner struct {
}

MeasurementsRunner will simply broadcast all events to `grafarg/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

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

OnSubscribe will let anyone connect to the path

type TestDataSupplier

type TestDataSupplier struct {
	Publisher models.ChannelPublisher
}

TestDataSupplier manages all the `grafarg/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.

Jump to

Keyboard shortcuts

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