Documentation ¶
Overview ¶
Package runstream is a generated GoMock package.
Index ¶
- type ChannelLocalPublisher
- type Manager
- func (s *Manager) HandleDatasourceDelete(orgID int64, dsUID string) error
- func (s *Manager) HandleDatasourceUpdate(orgID int64, dsUID string) error
- func (s *Manager) Run(ctx context.Context) error
- func (s *Manager) SubmitStream(ctx context.Context, user *user.SignedInUser, channel string, path string, ...) (*submitResult, error)
- type ManagerOption
- type MockChannelLocalPublisher
- type MockChannelLocalPublisherMockRecorder
- type MockNumLocalSubscribersGetter
- type MockNumLocalSubscribersGetterMockRecorder
- type MockPluginContextGetter
- type MockPluginContextGetterMockRecorder
- type MockStreamRunner
- type MockStreamRunnerMockRecorder
- type NumLocalSubscribersGetter
- type PluginContextGetter
- type StreamRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelLocalPublisher ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages streams from Grafana to plugins (i.e. RunStream method).
func NewManager ¶
func NewManager(channelSender ChannelLocalPublisher, presenceGetter NumLocalSubscribersGetter, pluginContextGetter PluginContextGetter, opts ...ManagerOption) *Manager
NewManager creates new Manager.
func (*Manager) HandleDatasourceDelete ¶
func (*Manager) HandleDatasourceUpdate ¶
func (*Manager) SubmitStream ¶
func (s *Manager) SubmitStream(ctx context.Context, user *user.SignedInUser, channel string, path string, data []byte, pCtx backend.PluginContext, streamRunner StreamRunner, isResubmit bool) (*submitResult, error)
SubmitStream submits stream handler in Manager to manage. The stream will be opened and kept till channel has active subscribers.
type ManagerOption ¶
type ManagerOption func(*Manager)
ManagerOption modifies Manager behavior (used for tests for example).
func WithCheckConfig ¶
func WithCheckConfig(interval time.Duration, maxChecks int) ManagerOption
WithCheckConfig allows setting custom check rules.
type MockChannelLocalPublisher ¶
type MockChannelLocalPublisher struct {
// contains filtered or unexported fields
}
MockChannelLocalPublisher is a mock of ChannelLocalPublisher interface.
func NewMockChannelLocalPublisher ¶
func NewMockChannelLocalPublisher(ctrl *gomock.Controller) *MockChannelLocalPublisher
NewMockChannelLocalPublisher creates a new mock instance.
func (*MockChannelLocalPublisher) EXPECT ¶
func (m *MockChannelLocalPublisher) EXPECT() *MockChannelLocalPublisherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockChannelLocalPublisher) PublishLocal ¶
func (m *MockChannelLocalPublisher) PublishLocal(arg0 string, arg1 []byte) error
PublishLocal mocks base method.
type MockChannelLocalPublisherMockRecorder ¶
type MockChannelLocalPublisherMockRecorder struct {
// contains filtered or unexported fields
}
MockChannelLocalPublisherMockRecorder is the mock recorder for MockChannelLocalPublisher.
func (*MockChannelLocalPublisherMockRecorder) PublishLocal ¶
func (mr *MockChannelLocalPublisherMockRecorder) PublishLocal(arg0, arg1 interface{}) *gomock.Call
PublishLocal indicates an expected call of PublishLocal.
type MockNumLocalSubscribersGetter ¶
type MockNumLocalSubscribersGetter struct {
// contains filtered or unexported fields
}
MockNumLocalSubscribersGetter is a mock of NumLocalSubscribersGetter interface.
func NewMockNumLocalSubscribersGetter ¶
func NewMockNumLocalSubscribersGetter(ctrl *gomock.Controller) *MockNumLocalSubscribersGetter
NewMockNumLocalSubscribersGetter creates a new mock instance.
func (*MockNumLocalSubscribersGetter) EXPECT ¶
func (m *MockNumLocalSubscribersGetter) EXPECT() *MockNumLocalSubscribersGetterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockNumLocalSubscribersGetter) GetNumLocalSubscribers ¶
func (m *MockNumLocalSubscribersGetter) GetNumLocalSubscribers(arg0 string) (int, error)
GetNumLocalSubscribers mocks base method.
type MockNumLocalSubscribersGetterMockRecorder ¶
type MockNumLocalSubscribersGetterMockRecorder struct {
// contains filtered or unexported fields
}
MockNumLocalSubscribersGetterMockRecorder is the mock recorder for MockNumLocalSubscribersGetter.
func (*MockNumLocalSubscribersGetterMockRecorder) GetNumLocalSubscribers ¶
func (mr *MockNumLocalSubscribersGetterMockRecorder) GetNumLocalSubscribers(arg0 interface{}) *gomock.Call
GetNumLocalSubscribers indicates an expected call of GetNumLocalSubscribers.
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 MockStreamRunner ¶
type MockStreamRunner struct {
// contains filtered or unexported fields
}
MockStreamRunner is a mock of StreamRunner interface.
func NewMockStreamRunner ¶
func NewMockStreamRunner(ctrl *gomock.Controller) *MockStreamRunner
NewMockStreamRunner creates a new mock instance.
func (*MockStreamRunner) EXPECT ¶
func (m *MockStreamRunner) EXPECT() *MockStreamRunnerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStreamRunner) RunStream ¶
func (m *MockStreamRunner) RunStream(arg0 context.Context, arg1 *backend.RunStreamRequest, arg2 *backend.StreamSender) error
RunStream mocks base method.
type MockStreamRunnerMockRecorder ¶
type MockStreamRunnerMockRecorder struct {
// contains filtered or unexported fields
}
MockStreamRunnerMockRecorder is the mock recorder for MockStreamRunner.
func (*MockStreamRunnerMockRecorder) RunStream ¶
func (mr *MockStreamRunnerMockRecorder) RunStream(arg0, arg1, arg2 interface{}) *gomock.Call
RunStream indicates an expected call of RunStream.
type PluginContextGetter ¶
type PluginContextGetter interface {
GetPluginContext(ctx context.Context, user *user.SignedInUser, pluginID string, datasourceUID string, skipCache bool) (backend.PluginContext, error)
}
type StreamRunner ¶
type StreamRunner interface {
RunStream(ctx context.Context, request *backend.RunStreamRequest, sender *backend.StreamSender) error
}