live

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConvertDryRunRequest

type ConvertDryRunRequest struct {
	ChannelRules []pipeline.ChannelRule `json:"channelRules"`
	Channel      string                 `json:"channel"`
	Data         string                 `json:"data"`
}

type ConvertDryRunResponse

type ConvertDryRunResponse struct {
	ChannelFrames []*pipeline.ChannelFrame `json:"channelFrames"`
}

type CoreGrafanaScope

type CoreGrafanaScope struct {
	Features map[string]models.ChannelHandlerFactory

	// The generic service to advertise dashboard changes
	Dashboards models.DashboardActivityChannel
}

CoreGrafanaScope list of core features

type DryRunRuleStorage

type DryRunRuleStorage struct {
	ChannelRules []pipeline.ChannelRule
}

func (*DryRunRuleStorage) CreateChannelRule

func (*DryRunRuleStorage) CreateWriteConfig

func (*DryRunRuleStorage) DeleteChannelRule

func (*DryRunRuleStorage) DeleteWriteConfig

func (*DryRunRuleStorage) GetWriteConfig

func (*DryRunRuleStorage) ListChannelRules

func (s *DryRunRuleStorage) ListChannelRules(_ context.Context, _ int64) ([]pipeline.ChannelRule, error)

func (*DryRunRuleStorage) ListWriteConfigs

func (s *DryRunRuleStorage) ListWriteConfigs(_ context.Context, _ int64) ([]pipeline.WriteConfig, error)

func (*DryRunRuleStorage) UpdateChannelRule

func (*DryRunRuleStorage) UpdateWriteConfig

type GrafanaLive

type GrafanaLive struct {
	PluginContextProvider *plugincontext.Provider
	Cfg                   *setting.Cfg
	Features              featuremgmt.FeatureToggles
	RouteRegister         routing.RouteRegister
	CacheService          *localcache.CacheService
	DataSourceCache       datasources.CacheService
	SQLStore              *sqlstore.SQLStore
	SecretsService        secrets.Service

	// The core internal features
	GrafanaScope CoreGrafanaScope

	ManagedStreamRunner *managedstream.Runner
	Pipeline            *pipeline.Pipeline
	// contains filtered or unexported fields
}

GrafanaLive manages live real-time connections to Grafana (over WebSocket at this moment). The main concept here is Channel. Connections can subscribe to many channels. Each channel can have different permissions and properties but once a connection subscribed to a channel it starts receiving all messages published into this channel. Thus GrafanaLive is a PUB/SUB server.

func ProvideService

func ProvideService(plugCtxProvider *plugincontext.Provider, cfg *setting.Cfg, routeRegister routing.RouteRegister,
	pluginStore plugins.Store, cacheService *localcache.CacheService,
	dataSourceCache datasources.CacheService, sqlStore *sqlstore.SQLStore, secretsService secrets.Service,
	usageStatsService usagestats.Service, queryDataService *query.Service, toggles featuremgmt.FeatureToggles,
	accessControl accesscontrol.AccessControl) (*GrafanaLive, error)

func (*GrafanaLive) ClientCount

func (g *GrafanaLive) ClientCount(orgID int64, channel string) (int, error)

ClientCount returns the number of clients.

func (*GrafanaLive) GetChannelHandler

func (g *GrafanaLive) GetChannelHandler(ctx context.Context, user *models.SignedInUser, channel string) (models.ChannelHandler, live.Channel, error)

GetChannelHandler gives thread-safe access to the channel.

func (*GrafanaLive) GetChannelHandlerFactory

func (g *GrafanaLive) GetChannelHandlerFactory(ctx context.Context, user *models.SignedInUser, scope string, namespace string) (models.ChannelHandlerFactory, error)

GetChannelHandlerFactory gets a ChannelHandlerFactory for a namespace. It gives thread-safe access to the channel.

func (*GrafanaLive) HandleChannelRulesDeleteHTTP

func (g *GrafanaLive) HandleChannelRulesDeleteHTTP(c *models.ReqContext) response.Response

HandleChannelRulesDeleteHTTP ...

func (*GrafanaLive) HandleChannelRulesListHTTP

func (g *GrafanaLive) HandleChannelRulesListHTTP(c *models.ReqContext) response.Response

HandleChannelRulesListHTTP ...

func (*GrafanaLive) HandleChannelRulesPostHTTP

func (g *GrafanaLive) HandleChannelRulesPostHTTP(c *models.ReqContext) response.Response

HandleChannelRulesPostHTTP ...

func (*GrafanaLive) HandleChannelRulesPutHTTP

func (g *GrafanaLive) HandleChannelRulesPutHTTP(c *models.ReqContext) response.Response

HandleChannelRulesPutHTTP ...

func (*GrafanaLive) HandleDatasourceDelete

func (g *GrafanaLive) HandleDatasourceDelete(orgID int64, dsUID string)

func (*GrafanaLive) HandleDatasourceUpdate

func (g *GrafanaLive) HandleDatasourceUpdate(orgID int64, dsUID string)

func (*GrafanaLive) HandleHTTPPublish

func (g *GrafanaLive) HandleHTTPPublish(ctx *models.ReqContext) response.Response

func (*GrafanaLive) HandleInfoHTTP

func (g *GrafanaLive) HandleInfoHTTP(ctx *models.ReqContext) response.Response

HandleInfoHTTP special http response for

func (*GrafanaLive) HandleListHTTP

func (g *GrafanaLive) HandleListHTTP(c *models.ReqContext) response.Response

HandleListHTTP returns metadata so the UI can build a nice form

func (*GrafanaLive) HandlePipelineConvertTestHTTP

func (g *GrafanaLive) HandlePipelineConvertTestHTTP(c *models.ReqContext) response.Response

HandlePipelineConvertTestHTTP ...

func (*GrafanaLive) HandlePipelineEntitiesListHTTP

func (g *GrafanaLive) HandlePipelineEntitiesListHTTP(_ *models.ReqContext) response.Response

HandlePipelineEntitiesListHTTP ...

func (*GrafanaLive) HandleWriteConfigsDeleteHTTP

func (g *GrafanaLive) HandleWriteConfigsDeleteHTTP(c *models.ReqContext) response.Response

HandleWriteConfigsDeleteHTTP ...

func (*GrafanaLive) HandleWriteConfigsListHTTP

func (g *GrafanaLive) HandleWriteConfigsListHTTP(c *models.ReqContext) response.Response

HandleWriteConfigsListHTTP ...

func (*GrafanaLive) HandleWriteConfigsPostHTTP

func (g *GrafanaLive) HandleWriteConfigsPostHTTP(c *models.ReqContext) response.Response

HandleWriteConfigsPostHTTP ...

func (*GrafanaLive) HandleWriteConfigsPutHTTP

func (g *GrafanaLive) HandleWriteConfigsPutHTTP(c *models.ReqContext) response.Response

HandleWriteConfigsPutHTTP ...

func (*GrafanaLive) IsHA

func (g *GrafanaLive) IsHA() bool

func (*GrafanaLive) Publish

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

Publish sends the data to the channel without checking permissions etc.

func (*GrafanaLive) Run

func (g *GrafanaLive) Run(ctx context.Context) error

Directories

Path Synopsis
Package features is a generated GoMock package.
Package features is a generated GoMock package.
Package pipeline is a generated GoMock package.
Package pipeline is a generated GoMock package.
Package runstream is a generated GoMock package.
Package runstream is a generated GoMock package.

Jump to

Keyboard shortcuts

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