pubsub

package
v0.0.0-...-c28e036 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package pubsub is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePubSubTopicsAndSubs

func CreatePubSubTopicsAndSubs(ctx context.Context, pubSubClient *pubsub.Client) (listSub, copySub, controlSub, deleteSub *pubsub.Subscription, listTopic, copyTopic, pulseTopic, deleteTopic *pubsub.Topic)

CreatePubSubTopicsAndSubs creates all of the PubSub topics and subs necessary for the Agent. If any of them can't be successfully created this function will glog.Fatal and kill the Agent.

Where not overridden, the DefaultReceiveSettings are:

ReceiveSettings{
      MaxExtension:           10 * time.Minute,
      MaxOutstandingMessages: 1000,
      MaxOutstandingBytes:    1e9,
      NumGoroutines:          1,
}

The default settings should be safe, because of the following reasons * MaxExtension: DCP should not publish messages that are estimated to take more than 10 mins. * MaxOutstandingMessages: It's also capped by the memory, and this will speed up processing of small files. * MaxOutstandingBytes: 1GB memory should not be a problem for a modern machine. * NumGoroutines: Does not need more than 1 routine to pull Pub/Sub messages.

Types

type MockPS

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

MockPS is a mock of PS interface

func NewMockPS

func NewMockPS(ctrl *gomock.Controller) *MockPS

NewMockPS creates a new mock instance

func (*MockPS) EXPECT

func (m *MockPS) EXPECT() *MockPSMockRecorder

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

func (*MockPS) Subscription

func (m *MockPS) Subscription(id string) PSSubscription

Subscription mocks base method

func (*MockPS) Topic

func (m *MockPS) Topic(id string) PSTopic

Topic mocks base method

func (*MockPS) TopicInProject

func (m *MockPS) TopicInProject(id, projectID string) PSTopic

TopicInProject mocks base method

type MockPSMockRecorder

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

MockPSMockRecorder is the mock recorder for MockPS

func (*MockPSMockRecorder) Subscription

func (mr *MockPSMockRecorder) Subscription(id interface{}) *gomock.Call

Subscription indicates an expected call of Subscription

func (*MockPSMockRecorder) Topic

func (mr *MockPSMockRecorder) Topic(id interface{}) *gomock.Call

Topic indicates an expected call of Topic

func (*MockPSMockRecorder) TopicInProject

func (mr *MockPSMockRecorder) TopicInProject(id, projectID interface{}) *gomock.Call

TopicInProject indicates an expected call of TopicInProject

type MockPSPublishResult

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

MockPSPublishResult is a mock of PSPublishResult interface

func NewMockPSPublishResult

func NewMockPSPublishResult(ctrl *gomock.Controller) *MockPSPublishResult

NewMockPSPublishResult creates a new mock instance

func (*MockPSPublishResult) EXPECT

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

func (*MockPSPublishResult) Get

Get mocks base method

type MockPSPublishResultMockRecorder

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

MockPSPublishResultMockRecorder is the mock recorder for MockPSPublishResult

func (*MockPSPublishResultMockRecorder) Get

func (mr *MockPSPublishResultMockRecorder) Get(ctx interface{}) *gomock.Call

Get indicates an expected call of Get

type MockPSSubscription

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

MockPSSubscription is a mock of PSSubscription interface

func NewMockPSSubscription

func NewMockPSSubscription(ctrl *gomock.Controller) *MockPSSubscription

NewMockPSSubscription creates a new mock instance

func (*MockPSSubscription) Config

Config mocks base method

func (*MockPSSubscription) Delete

func (m *MockPSSubscription) Delete(ctx context.Context) error

Delete mocks base method

func (*MockPSSubscription) EXPECT

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

func (*MockPSSubscription) Exists

func (m *MockPSSubscription) Exists(ctx context.Context) (bool, error)

Exists mocks base method

func (*MockPSSubscription) ID

func (m *MockPSSubscription) ID() string

ID mocks base method

func (*MockPSSubscription) Receive

func (m *MockPSSubscription) Receive(ctx context.Context, f func(context.Context, *pubsub.Message)) error

Receive mocks base method

type MockPSSubscriptionConfig

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

MockPSSubscriptionConfig is a mock of PSSubscriptionConfig interface

func NewMockPSSubscriptionConfig

func NewMockPSSubscriptionConfig(ctrl *gomock.Controller) *MockPSSubscriptionConfig

NewMockPSSubscriptionConfig creates a new mock instance

func (*MockPSSubscriptionConfig) EXPECT

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

func (*MockPSSubscriptionConfig) Topic

func (m *MockPSSubscriptionConfig) Topic() PSTopic

Topic mocks base method

type MockPSSubscriptionConfigMockRecorder

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

MockPSSubscriptionConfigMockRecorder is the mock recorder for MockPSSubscriptionConfig

func (*MockPSSubscriptionConfigMockRecorder) Topic

Topic indicates an expected call of Topic

type MockPSSubscriptionMockRecorder

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

MockPSSubscriptionMockRecorder is the mock recorder for MockPSSubscription

func (*MockPSSubscriptionMockRecorder) Config

func (mr *MockPSSubscriptionMockRecorder) Config(ctx interface{}) *gomock.Call

Config indicates an expected call of Config

func (*MockPSSubscriptionMockRecorder) Delete

func (mr *MockPSSubscriptionMockRecorder) Delete(ctx interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockPSSubscriptionMockRecorder) Exists

func (mr *MockPSSubscriptionMockRecorder) Exists(ctx interface{}) *gomock.Call

Exists indicates an expected call of Exists

func (*MockPSSubscriptionMockRecorder) ID

ID indicates an expected call of ID

func (*MockPSSubscriptionMockRecorder) Receive

func (mr *MockPSSubscriptionMockRecorder) Receive(ctx, f interface{}) *gomock.Call

Receive indicates an expected call of Receive

type MockPSTopic

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

MockPSTopic is a mock of PSTopic interface

func NewMockPSTopic

func NewMockPSTopic(ctrl *gomock.Controller) *MockPSTopic

NewMockPSTopic creates a new mock instance

func (*MockPSTopic) Delete

func (m *MockPSTopic) Delete(ctx context.Context) error

Delete mocks base method

func (*MockPSTopic) EXPECT

func (m *MockPSTopic) EXPECT() *MockPSTopicMockRecorder

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

func (*MockPSTopic) Exists

func (m *MockPSTopic) Exists(ctx context.Context) (bool, error)

Exists mocks base method

func (*MockPSTopic) ID

func (m *MockPSTopic) ID() string

ID mocks base method

func (*MockPSTopic) Publish

func (m *MockPSTopic) Publish(ctx context.Context, msg *pubsub.Message) PSPublishResult

Publish mocks base method

func (*MockPSTopic) Stop

func (m *MockPSTopic) Stop()

Stop mocks base method

type MockPSTopicMockRecorder

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

MockPSTopicMockRecorder is the mock recorder for MockPSTopic

func (*MockPSTopicMockRecorder) Delete

func (mr *MockPSTopicMockRecorder) Delete(ctx interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockPSTopicMockRecorder) Exists

func (mr *MockPSTopicMockRecorder) Exists(ctx interface{}) *gomock.Call

Exists indicates an expected call of Exists

func (*MockPSTopicMockRecorder) ID

ID indicates an expected call of ID

func (*MockPSTopicMockRecorder) Publish

func (mr *MockPSTopicMockRecorder) Publish(ctx, msg interface{}) *gomock.Call

Publish indicates an expected call of Publish

func (*MockPSTopicMockRecorder) Stop

func (mr *MockPSTopicMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop

type PS

type PS interface {
	Topic(id string) PSTopic
	TopicInProject(id, projectID string) PSTopic
	Subscription(id string) PSSubscription
}

type PSPublishResult

type PSPublishResult interface {
	Get(ctx context.Context) (serverID string, err error)
}

type PSSubscription

type PSSubscription interface {
	Receive(ctx context.Context, f func(context.Context, *pubsub.Message)) error
	ID() string
	Delete(ctx context.Context) error
	Config(ctx context.Context) (PSSubscriptionConfig, error)
	Exists(ctx context.Context) (bool, error)
}

type PSSubscriptionConfig

type PSSubscriptionConfig interface {
	Topic() PSTopic
}

func NewPubSubSubscriptionConfig

func NewPubSubSubscriptionConfig(topic PSTopic) PSSubscriptionConfig

type PSTopic

type PSTopic interface {
	Publish(ctx context.Context, msg *pubsub.Message) PSPublishResult
	Stop()
	ID() string
	Delete(ctx context.Context) error
	Exists(ctx context.Context) (bool, error)
}

type PubSubClient

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

func NewPubSubClient

func NewPubSubClient(client *pubsub.Client) *PubSubClient

func (*PubSubClient) NewPubSubClient

func (c *PubSubClient) NewPubSubClient(ctx context.Context, projectID string) (*pubsub.Client, error)

func (*PubSubClient) Subscription

func (c *PubSubClient) Subscription(id string) PSSubscription

func (*PubSubClient) Topic

func (c *PubSubClient) Topic(id string) PSTopic

func (*PubSubClient) TopicInProject

func (c *PubSubClient) TopicInProject(id, projectID string) PSTopic

type PubSubPublishResult

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

func (*PubSubPublishResult) Get

func (p *PubSubPublishResult) Get(ctx context.Context) (serverID string, err error)

type PubSubSubscription

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

func (*PubSubSubscription) Config

func (*PubSubSubscription) Delete

func (s *PubSubSubscription) Delete(ctx context.Context) error

func (*PubSubSubscription) Exists

func (s *PubSubSubscription) Exists(ctx context.Context) (bool, error)

func (*PubSubSubscription) ID

func (s *PubSubSubscription) ID() string

func (*PubSubSubscription) Receive

func (s *PubSubSubscription) Receive(ctx context.Context, f func(context.Context, *pubsub.Message)) error

type PubSubSubscriptionConfig

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

func (*PubSubSubscriptionConfig) Topic

func (c *PubSubSubscriptionConfig) Topic() PSTopic

type PubSubSubscriptionWrapper

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

func NewPubSubSubscriptionWrapper

func NewPubSubSubscriptionWrapper(s *pubsub.Subscription) *PubSubSubscriptionWrapper

NewPubSubSubscriptionWrapper wraps a pubsub.Subscription to ensure its Config function can return mock results

func (*PubSubSubscriptionWrapper) Config

func (*PubSubSubscriptionWrapper) Delete

func (*PubSubSubscriptionWrapper) Exists

func (*PubSubSubscriptionWrapper) ID

func (*PubSubSubscriptionWrapper) Receive

type PubSubTopic

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

func (*PubSubTopic) Delete

func (t *PubSubTopic) Delete(ctx context.Context) error

func (*PubSubTopic) Exists

func (t *PubSubTopic) Exists(ctx context.Context) (bool, error)

func (*PubSubTopic) ID

func (t *PubSubTopic) ID() string

func (*PubSubTopic) Publish

func (t *PubSubTopic) Publish(ctx context.Context, msg *pubsub.Message) PSPublishResult

func (*PubSubTopic) Stop

func (t *PubSubTopic) Stop()

type PubSubTopicWrapper

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

func NewPubSubTopicWrapper

func NewPubSubTopicWrapper(t *pubsub.Topic) *PubSubTopicWrapper

NewPubSubTopicWrapper wraps a pubsub.Topic to ensure its Publish function can return mock results

func (*PubSubTopicWrapper) Delete

func (w *PubSubTopicWrapper) Delete(ctx context.Context) error

func (*PubSubTopicWrapper) Exists

func (w *PubSubTopicWrapper) Exists(ctx context.Context) (bool, error)

func (*PubSubTopicWrapper) ID

func (w *PubSubTopicWrapper) ID() string

func (*PubSubTopicWrapper) Publish

func (*PubSubTopicWrapper) Stop

func (w *PubSubTopicWrapper) Stop()

Jump to

Keyboard shortcuts

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