mock_pubsub

package
v0.15.1-rc.7 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MockProjectID = "mock-project"

Variables

This section is empty.

Functions

This section is empty.

Types

type MockBaseClient

type MockBaseClient struct {
	Messages      map[string][]ifaces_pubsub.Message
	CompleteError error
}

func (MockBaseClient) Acknowledge

func (m MockBaseClient) Acknowledge(ctx context.Context, req *pubsubpb.AcknowledgeRequest, opts ...gax.CallOption) error

func (MockBaseClient) Close

func (m MockBaseClient) Close() error

func (MockBaseClient) Pull

func (m MockBaseClient) Pull(ctx context.Context, req *pubsubpb.PullRequest, opts ...gax.CallOption) (*pubsubpb.PullResponse, error)

type MockPublishResult

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

func (*MockPublishResult) Get

type MockPubsubClient

type MockPubsubClient struct {
	ifaces_pubsub.PubsubClient

	PublishedMessages map[string][]ifaces_pubsub.Message
	// contains filtered or unexported fields
}

func NewMockPubsubClient

func NewMockPubsubClient(opts MockPubsubOptions) *MockPubsubClient

func (*MockPubsubClient) Topic

func (s *MockPubsubClient) Topic(name string) ifaces_pubsub.Topic

func (*MockPubsubClient) Topics

type MockPubsubMessage

type MockPubsubMessage struct {
	Id        string
	AckId     string
	DataBytes []byte
}

func (MockPubsubMessage) Ack

func (m MockPubsubMessage) Ack()

func (MockPubsubMessage) Attributes

func (m MockPubsubMessage) Attributes() map[string]string

func (MockPubsubMessage) Data

func (m MockPubsubMessage) Data() []byte

func (MockPubsubMessage) ID

func (m MockPubsubMessage) ID() string

func (MockPubsubMessage) Nack

func (m MockPubsubMessage) Nack()

func (MockPubsubMessage) PublishTime

func (m MockPubsubMessage) PublishTime() time.Time

type MockPubsubOptions

type MockPubsubOptions struct {
	Topics   []string
	Messages map[string][]ifaces_pubsub.Message
}

type MockPubsubTopic

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

func (*MockPubsubTopic) Exists

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

func (*MockPubsubTopic) ID

func (s *MockPubsubTopic) ID() string

func (*MockPubsubTopic) Publish

func (*MockPubsubTopic) String

func (s *MockPubsubTopic) String() string

func (*MockPubsubTopic) Subscriptions

type MockSubscription

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

func (MockSubscription) ID

func (m MockSubscription) ID() string

func (MockSubscription) String

func (m MockSubscription) String() string

Return the full unique name for the subscription, in the format "projects/{project}/subscriptions/{subscription}"

type MockSubscriptionIterator

type MockSubscriptionIterator struct {
	Subscriptions []ifaces_pubsub.Subscription
	// contains filtered or unexported fields
}

func (*MockSubscriptionIterator) Next

type MockTopicIterator

type MockTopicIterator struct {
	ifaces_pubsub.TopicIterator
	// contains filtered or unexported fields
}

func (*MockTopicIterator) Next

Jump to

Keyboard shortcuts

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