Documentation ¶
Overview ¶
Package features is a generated GoMock package.
Package features is a generated GoMock package.
Index ¶
- Constants
- type BroadcastRunner
- func (b *BroadcastRunner) GetHandlerForPath(_ string) (model.ChannelHandler, error)
- func (b *BroadcastRunner) OnPublish(_ context.Context, u *user.SignedInUser, e model.PublishEvent) (model.PublishReply, backend.PublishStreamStatus, error)
- func (b *BroadcastRunner) OnSubscribe(_ context.Context, u *user.SignedInUser, e model.SubscribeEvent) (model.SubscribeReply, backend.SubscribeStreamStatus, error)
- type DashboardHandler
- func (h *DashboardHandler) DashboardDeleted(orgID int64, user *user.UserDisplayDTO, uid string) error
- func (h *DashboardHandler) DashboardSaved(orgID int64, user *user.UserDisplayDTO, message string, ...) error
- func (h *DashboardHandler) GetHandlerForPath(_ string) (model.ChannelHandler, error)
- func (h *DashboardHandler) HasGitOpsObserver(orgID int64) bool
- func (h *DashboardHandler) OnPublish(ctx context.Context, user *user.SignedInUser, e model.PublishEvent) (model.PublishReply, backend.PublishStreamStatus, error)
- func (h *DashboardHandler) OnSubscribe(ctx context.Context, user *user.SignedInUser, e model.SubscribeEvent) (model.SubscribeReply, backend.SubscribeStreamStatus, error)
- type LiveMessageStore
- type MockLiveMessageStore
- type MockLiveMessageStoreMockRecorder
- type MockPluginContextGetter
- type MockPluginContextGetterMockRecorder
- type PluginContextGetter
- type PluginPathRunner
- func (r *PluginPathRunner) OnPublish(ctx context.Context, user *user.SignedInUser, e model.PublishEvent) (model.PublishReply, backend.PublishStreamStatus, error)
- func (r *PluginPathRunner) OnSubscribe(ctx context.Context, user *user.SignedInUser, e model.SubscribeEvent) (model.SubscribeReply, backend.SubscribeStreamStatus, error)
- type PluginRunner
Constants ¶
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 ¶
func (b *BroadcastRunner) OnPublish(_ context.Context, u *user.SignedInUser, e model.PublishEvent) (model.PublishReply, backend.PublishStreamStatus, error)
OnPublish is called when a client wants to broadcast on the websocket
func (*BroadcastRunner) OnSubscribe ¶
func (b *BroadcastRunner) OnSubscribe(_ context.Context, u *user.SignedInUser, e model.SubscribeEvent) (model.SubscribeReply, backend.SubscribeStreamStatus, error)
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 ¶
func (h *DashboardHandler) OnPublish(ctx context.Context, user *user.SignedInUser, e model.PublishEvent) (model.PublishReply, backend.PublishStreamStatus, error)
OnPublish is called when someone begins to edit a dashboard
func (*DashboardHandler) OnSubscribe ¶
func (h *DashboardHandler) OnSubscribe(ctx context.Context, user *user.SignedInUser, e model.SubscribeEvent) (model.SubscribeReply, backend.SubscribeStreamStatus, error)
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 ¶
func (m *MockLiveMessageStore) EXPECT() *MockLiveMessageStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLiveMessageStore) GetLiveMessage ¶
func (m *MockLiveMessageStore) GetLiveMessage(arg0 *model.GetLiveMessageQuery) (model.LiveMessage, bool, error)
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 ¶
func (m *MockPluginContextGetter) EXPECT() *MockPluginContextGetterMockRecorder
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 ¶
func (r *PluginPathRunner) OnPublish(ctx context.Context, user *user.SignedInUser, e model.PublishEvent) (model.PublishReply, backend.PublishStreamStatus, error)
OnPublish passes control to a plugin.
func (*PluginPathRunner) OnSubscribe ¶
func (r *PluginPathRunner) OnSubscribe(ctx context.Context, user *user.SignedInUser, e model.SubscribeEvent) (model.SubscribeReply, backend.SubscribeStreamStatus, error)
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.