features

package
v0.0.0-testrgm6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package features is a generated GoMock package.

Package features is a generated GoMock package.

Index

Constants

View Source
const (
	ActionSaved    actionType = "saved"
	ActionDeleted  actionType = "deleted"
	EditingStarted actionType = "editing-started"

	GitopsChannel = "grafana/dashboard/gitops"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadcastRunner

type BroadcastRunner struct {
	// contains filtered or unexported fields
}

BroadcastRunner will simply broadcast all events to `grafana/broadcast/*` channels This assumes that data is a JSON object

func NewBroadcastRunner

func NewBroadcastRunner(liveMessageStore LiveMessageStore) *BroadcastRunner

func (*BroadcastRunner) GetHandlerForPath

func (b *BroadcastRunner) GetHandlerForPath(_ string) (model.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        model.ChannelPublisher
	ClientCount      model.ChannelClientCount
	Store            db.DB
	DashboardService dashboards.DashboardService
}

DashboardHandler manages all the `grafana/dashboard/*` channels

func (*DashboardHandler) DashboardDeleted

func (h *DashboardHandler) DashboardDeleted(orgID int64, user *user.UserDisplayDTO, uid string) error

DashboardDeleted will broadcast to all connected dashboards

func (*DashboardHandler) DashboardSaved

func (h *DashboardHandler) DashboardSaved(orgID int64, user *user.UserDisplayDTO, message string, dashboard *dashboards.Dashboard, err error) error

DashboardSaved will broadcast to all connected dashboards

func (*DashboardHandler) GetHandlerForPath

func (h *DashboardHandler) GetHandlerForPath(_ string) (model.ChannelHandler, error)

GetHandlerForPath called on init

func (*DashboardHandler) HasGitOpsObserver

func (h *DashboardHandler) HasGitOpsObserver(orgID int64) bool

HasGitOpsObserver will return true if anyone is listening to the `gitops` channel

func (*DashboardHandler) OnPublish

OnPublish is called when someone begins to edit a dashboard

func (*DashboardHandler) OnSubscribe

OnSubscribe for now allows anyone to subscribe to any dashboard

type LiveMessageStore

type LiveMessageStore interface {
	SaveLiveMessage(query *model.SaveLiveMessageQuery) error
	GetLiveMessage(query *model.GetLiveMessageQuery) (model.LiveMessage, bool, error)
}

type MockLiveMessageStore

type MockLiveMessageStore struct {
	// contains filtered or unexported fields
}

MockLiveMessageStore is a mock of LiveMessageStore interface.

func NewMockLiveMessageStore

func NewMockLiveMessageStore(ctrl *gomock.Controller) *MockLiveMessageStore

NewMockLiveMessageStore creates a new mock instance.

func (*MockLiveMessageStore) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockLiveMessageStore) GetLiveMessage

GetLiveMessage mocks base method.

func (*MockLiveMessageStore) SaveLiveMessage

func (m *MockLiveMessageStore) SaveLiveMessage(arg0 *model.SaveLiveMessageQuery) error

SaveLiveMessage mocks base method.

type MockLiveMessageStoreMockRecorder

type MockLiveMessageStoreMockRecorder struct {
	// contains filtered or unexported fields
}

MockLiveMessageStoreMockRecorder is the mock recorder for MockLiveMessageStore.

func (*MockLiveMessageStoreMockRecorder) GetLiveMessage

func (mr *MockLiveMessageStoreMockRecorder) GetLiveMessage(arg0 interface{}) *gomock.Call

GetLiveMessage indicates an expected call of GetLiveMessage.

func (*MockLiveMessageStoreMockRecorder) SaveLiveMessage

func (mr *MockLiveMessageStoreMockRecorder) SaveLiveMessage(arg0 interface{}) *gomock.Call

SaveLiveMessage indicates an expected call of SaveLiveMessage.

type MockPluginContextGetter

type MockPluginContextGetter struct {
	// contains filtered or unexported fields
}

MockPluginContextGetter is a mock of PluginContextGetter interface.

func NewMockPluginContextGetter

func NewMockPluginContextGetter(ctrl *gomock.Controller) *MockPluginContextGetter

NewMockPluginContextGetter creates a new mock instance.

func (*MockPluginContextGetter) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPluginContextGetter) GetPluginContext

func (m *MockPluginContextGetter) GetPluginContext(arg0 context.Context, arg1 *user.SignedInUser, arg2, arg3 string, arg4 bool) (backend.PluginContext, error)

GetPluginContext mocks base method.

type MockPluginContextGetterMockRecorder

type MockPluginContextGetterMockRecorder struct {
	// contains filtered or unexported fields
}

MockPluginContextGetterMockRecorder is the mock recorder for MockPluginContextGetter.

func (*MockPluginContextGetterMockRecorder) GetPluginContext

func (mr *MockPluginContextGetterMockRecorder) GetPluginContext(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

GetPluginContext indicates an expected call of GetPluginContext.

type PluginContextGetter

type PluginContextGetter interface {
	GetPluginContext(ctx context.Context, user *user.SignedInUser, pluginID string, datasourceUID string, skipCache bool) (backend.PluginContext, error)
}

type PluginPathRunner

type PluginPathRunner struct {
	// contains filtered or unexported fields
}

PluginPathRunner can handle streaming operations for channels belonging to plugin specific path.

func (*PluginPathRunner) OnPublish

OnPublish passes control to a plugin.

func (*PluginPathRunner) OnSubscribe

OnSubscribe passes control to a plugin.

type PluginRunner

type PluginRunner struct {
	// contains filtered or unexported fields
}

PluginRunner can handle streaming operations for channels belonging to plugins.

func NewPluginRunner

func NewPluginRunner(pluginID string, datasourceUID string, runStreamManager *runstream.Manager, pluginContextGetter PluginContextGetter, handler backend.StreamHandler) *PluginRunner

NewPluginRunner creates new PluginRunner.

func (*PluginRunner) GetHandlerForPath

func (m *PluginRunner) GetHandlerForPath(path string) (model.ChannelHandler, error)

GetHandlerForPath gets the handler for a path.

Jump to

Keyboard shortcuts

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