runstream

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package runstream is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelLocalPublisher

type ChannelLocalPublisher interface {
	PublishLocal(channel string, data []byte) error
}

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 (s *Manager) HandleDatasourceDelete(orgID int64, dsUID string) error

func (*Manager) HandleDatasourceUpdate

func (s *Manager) HandleDatasourceUpdate(orgID int64, dsUID string) error

func (*Manager) Run

func (s *Manager) Run(ctx context.Context) error

Run Manager till context canceled.

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

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

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

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

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

func (*MockStreamRunner) RunStream

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 NumLocalSubscribersGetter

type NumLocalSubscribersGetter interface {
	// GetNumSubscribers returns number of channel subscribers throughout all nodes.
	GetNumLocalSubscribers(channel string) (int, error)
}

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
}

Jump to

Keyboard shortcuts

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