mock_pubsub

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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