Documentation ¶
Index ¶
- type ConvertDryRunRequest
- type ConvertDryRunResponse
- type CoreGrafanaScope
- type DashboardActivityChannel
- type DryRunRuleStorage
- func (s *DryRunRuleStorage) CreateChannelRule(_ context.Context, _ int64, _ pipeline.ChannelRuleCreateCmd) (pipeline.ChannelRule, error)
- func (s *DryRunRuleStorage) CreateWriteConfig(_ context.Context, _ int64, _ pipeline.WriteConfigCreateCmd) (pipeline.WriteConfig, error)
- func (s *DryRunRuleStorage) DeleteChannelRule(_ context.Context, _ int64, _ pipeline.ChannelRuleDeleteCmd) error
- func (s *DryRunRuleStorage) DeleteWriteConfig(_ context.Context, _ int64, _ pipeline.WriteConfigDeleteCmd) error
- func (s *DryRunRuleStorage) GetWriteConfig(_ context.Context, _ int64, _ pipeline.WriteConfigGetCmd) (pipeline.WriteConfig, bool, error)
- func (s *DryRunRuleStorage) ListChannelRules(_ context.Context, _ int64) ([]pipeline.ChannelRule, error)
- func (s *DryRunRuleStorage) ListWriteConfigs(_ context.Context, _ int64) ([]pipeline.WriteConfig, error)
- func (s *DryRunRuleStorage) UpdateChannelRule(_ context.Context, _ int64, _ pipeline.ChannelRuleUpdateCmd) (pipeline.ChannelRule, error)
- func (s *DryRunRuleStorage) UpdateWriteConfig(_ context.Context, _ int64, _ pipeline.WriteConfigUpdateCmd) (pipeline.WriteConfig, error)
- type GrafanaLive
- func (g *GrafanaLive) ClientCount(orgID int64, channel string) (int, error)
- func (g *GrafanaLive) GetChannelHandler(ctx context.Context, user *user.SignedInUser, channel string) (model.ChannelHandler, live.Channel, error)
- func (g *GrafanaLive) GetChannelHandlerFactory(ctx context.Context, user *user.SignedInUser, scope string, namespace string) (model.ChannelHandlerFactory, error)
- func (g *GrafanaLive) HandleChannelRulesDeleteHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleChannelRulesListHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleChannelRulesPostHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleChannelRulesPutHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleDatasourceDelete(orgID int64, dsUID string)
- func (g *GrafanaLive) HandleDatasourceUpdate(orgID int64, dsUID string)
- func (g *GrafanaLive) HandleHTTPPublish(ctx *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleInfoHTTP(ctx *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleListHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandlePipelineConvertTestHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandlePipelineEntitiesListHTTP(_ *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleWriteConfigsDeleteHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleWriteConfigsListHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleWriteConfigsPostHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) HandleWriteConfigsPutHTTP(c *contextmodel.ReqContext) response.Response
- func (g *GrafanaLive) IsHA() bool
- func (g *GrafanaLive) Publish(orgID int64, channel string, data []byte) error
- func (g *GrafanaLive) Run(ctx context.Context) error
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]model.ChannelHandlerFactory // The generic service to advertise dashboard changes Dashboards DashboardActivityChannel }
CoreGrafanaScope list of core features
type DashboardActivityChannel ¶
type DashboardActivityChannel interface { // Called when a dashboard is saved -- this includes the error so we can support a // gitops workflow that knows if the value was saved to the local database or not // in many cases all direct save requests will fail, but the request should be forwarded // to any gitops observers DashboardSaved(orgID int64, user *user.UserDisplayDTO, message string, dashboard *dashboards.Dashboard, err error) error // Called when a dashboard is deleted DashboardDeleted(orgID int64, user *user.UserDisplayDTO, uid string) error // Experimental! Indicate is GitOps is active. This really means // someone is subscribed to the `grafana/dashboards/gitops` channel HasGitOpsObserver(orgID int64) bool }
DashboardActivityChannel is a service to advertise dashboard activity
type DryRunRuleStorage ¶
type DryRunRuleStorage struct {
ChannelRules []pipeline.ChannelRule
}
func (*DryRunRuleStorage) CreateChannelRule ¶
func (s *DryRunRuleStorage) CreateChannelRule(_ context.Context, _ int64, _ pipeline.ChannelRuleCreateCmd) (pipeline.ChannelRule, error)
func (*DryRunRuleStorage) CreateWriteConfig ¶
func (s *DryRunRuleStorage) CreateWriteConfig(_ context.Context, _ int64, _ pipeline.WriteConfigCreateCmd) (pipeline.WriteConfig, error)
func (*DryRunRuleStorage) DeleteChannelRule ¶
func (s *DryRunRuleStorage) DeleteChannelRule(_ context.Context, _ int64, _ pipeline.ChannelRuleDeleteCmd) error
func (*DryRunRuleStorage) DeleteWriteConfig ¶
func (s *DryRunRuleStorage) DeleteWriteConfig(_ context.Context, _ int64, _ pipeline.WriteConfigDeleteCmd) error
func (*DryRunRuleStorage) GetWriteConfig ¶
func (s *DryRunRuleStorage) GetWriteConfig(_ context.Context, _ int64, _ pipeline.WriteConfigGetCmd) (pipeline.WriteConfig, bool, error)
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 (s *DryRunRuleStorage) UpdateChannelRule(_ context.Context, _ int64, _ pipeline.ChannelRuleUpdateCmd) (pipeline.ChannelRule, error)
func (*DryRunRuleStorage) UpdateWriteConfig ¶
func (s *DryRunRuleStorage) UpdateWriteConfig(_ context.Context, _ int64, _ pipeline.WriteConfigUpdateCmd) (pipeline.WriteConfig, error)
type GrafanaLive ¶
type GrafanaLive struct { PluginContextProvider *plugincontext.Provider Cfg *setting.Cfg Features featuremgmt.FeatureToggles RouteRegister routing.RouteRegister CacheService *localcache.CacheService DataSourceCache datasources.CacheService SQLStore db.DB 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, pluginClient plugins.Client, cacheService *localcache.CacheService, dataSourceCache datasources.CacheService, sqlStore db.DB, secretsService secrets.Service, usageStatsService usagestats.Service, queryDataService query.Service, toggles featuremgmt.FeatureToggles, accessControl accesscontrol.AccessControl, dashboardService dashboards.DashboardService, annotationsRepo annotations.Repository, orgService org.Service) (*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 *user.SignedInUser, channel string) (model.ChannelHandler, live.Channel, error)
GetChannelHandler gives thread-safe access to the channel.
func (*GrafanaLive) GetChannelHandlerFactory ¶
func (g *GrafanaLive) GetChannelHandlerFactory(ctx context.Context, user *user.SignedInUser, scope string, namespace string) (model.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 *contextmodel.ReqContext) response.Response
HandleChannelRulesDeleteHTTP ...
func (*GrafanaLive) HandleChannelRulesListHTTP ¶
func (g *GrafanaLive) HandleChannelRulesListHTTP(c *contextmodel.ReqContext) response.Response
HandleChannelRulesListHTTP ...
func (*GrafanaLive) HandleChannelRulesPostHTTP ¶
func (g *GrafanaLive) HandleChannelRulesPostHTTP(c *contextmodel.ReqContext) response.Response
HandleChannelRulesPostHTTP ...
func (*GrafanaLive) HandleChannelRulesPutHTTP ¶
func (g *GrafanaLive) HandleChannelRulesPutHTTP(c *contextmodel.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 *contextmodel.ReqContext) response.Response
func (*GrafanaLive) HandleInfoHTTP ¶
func (g *GrafanaLive) HandleInfoHTTP(ctx *contextmodel.ReqContext) response.Response
HandleInfoHTTP special http response for
func (*GrafanaLive) HandleListHTTP ¶
func (g *GrafanaLive) HandleListHTTP(c *contextmodel.ReqContext) response.Response
HandleListHTTP returns metadata so the UI can build a nice form
func (*GrafanaLive) HandlePipelineConvertTestHTTP ¶
func (g *GrafanaLive) HandlePipelineConvertTestHTTP(c *contextmodel.ReqContext) response.Response
HandlePipelineConvertTestHTTP ...
func (*GrafanaLive) HandlePipelineEntitiesListHTTP ¶
func (g *GrafanaLive) HandlePipelineEntitiesListHTTP(_ *contextmodel.ReqContext) response.Response
HandlePipelineEntitiesListHTTP ...
func (*GrafanaLive) HandleWriteConfigsDeleteHTTP ¶
func (g *GrafanaLive) HandleWriteConfigsDeleteHTTP(c *contextmodel.ReqContext) response.Response
HandleWriteConfigsDeleteHTTP ...
func (*GrafanaLive) HandleWriteConfigsListHTTP ¶
func (g *GrafanaLive) HandleWriteConfigsListHTTP(c *contextmodel.ReqContext) response.Response
HandleWriteConfigsListHTTP ...
func (*GrafanaLive) HandleWriteConfigsPostHTTP ¶
func (g *GrafanaLive) HandleWriteConfigsPostHTTP(c *contextmodel.ReqContext) response.Response
HandleWriteConfigsPostHTTP ...
func (*GrafanaLive) HandleWriteConfigsPutHTTP ¶
func (g *GrafanaLive) HandleWriteConfigsPutHTTP(c *contextmodel.ReqContext) response.Response
HandleWriteConfigsPutHTTP ...
func (*GrafanaLive) IsHA ¶
func (g *GrafanaLive) IsHA() bool
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. |