google

package
v1.28.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package google provides a client for interacting with Google Cloud Pub/Sub.This package facilitates interaction with Google Cloud Pub/Sub, allowing publishing and subscribing to topics, managing subscriptions, and handling messages.

Package google is a generated GoMock package.

Package google is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(conf Config, logger pubsub.Logger, metrics Metrics) *googleClient

Types

type Client

type Client interface {
	Writer
	Reader

	Close() error
	Topics(ctx context.Context) *pubsub.TopicIterator
	Subscriptions(ctx context.Context) *pubsub.SubscriptionIterator
}

type Config

type Config struct {
	ProjectID        string
	SubscriptionName string
}

type Metrics

type Metrics interface {
	IncrementCounter(ctx context.Context, name string, labels ...string)
}

type MockClient added in v1.28.2

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

MockClient is a mock of Client interface.

func NewMockClient added in v1.28.2

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) Close added in v1.28.2

func (m *MockClient) Close() error

Close mocks base method.

func (*MockClient) CreateSubscription added in v1.28.2

func (m *MockClient) CreateSubscription(ctx context.Context, id string, cfg pubsub.SubscriptionConfig) (*pubsub.Subscription, error)

CreateSubscription mocks base method.

func (*MockClient) CreateTopic added in v1.28.2

func (m *MockClient) CreateTopic(ctx context.Context, topicID string) (*pubsub.Topic, error)

CreateTopic mocks base method.

func (*MockClient) EXPECT added in v1.28.2

func (m *MockClient) EXPECT() *MockClientMockRecorder

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

func (*MockClient) Subscription added in v1.28.2

func (m *MockClient) Subscription(id string) *pubsub.Subscription

Subscription mocks base method.

func (*MockClient) Subscriptions added in v1.28.2

func (m *MockClient) Subscriptions(ctx context.Context) *pubsub.SubscriptionIterator

Subscriptions mocks base method.

func (*MockClient) Topic added in v1.28.2

func (m *MockClient) Topic(id string) *pubsub.Topic

Topic mocks base method.

func (*MockClient) Topics added in v1.28.2

func (m *MockClient) Topics(ctx context.Context) *pubsub.TopicIterator

Topics mocks base method.

type MockClientMockRecorder added in v1.28.2

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Close added in v1.28.2

func (mr *MockClientMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockClientMockRecorder) CreateSubscription added in v1.28.2

func (mr *MockClientMockRecorder) CreateSubscription(ctx, id, cfg any) *gomock.Call

CreateSubscription indicates an expected call of CreateSubscription.

func (*MockClientMockRecorder) CreateTopic added in v1.28.2

func (mr *MockClientMockRecorder) CreateTopic(ctx, topicID any) *gomock.Call

CreateTopic indicates an expected call of CreateTopic.

func (*MockClientMockRecorder) Subscription added in v1.28.2

func (mr *MockClientMockRecorder) Subscription(id any) *gomock.Call

Subscription indicates an expected call of Subscription.

func (*MockClientMockRecorder) Subscriptions added in v1.28.2

func (mr *MockClientMockRecorder) Subscriptions(ctx any) *gomock.Call

Subscriptions indicates an expected call of Subscriptions.

func (*MockClientMockRecorder) Topic added in v1.28.2

func (mr *MockClientMockRecorder) Topic(id any) *gomock.Call

Topic indicates an expected call of Topic.

func (*MockClientMockRecorder) Topics added in v1.28.2

func (mr *MockClientMockRecorder) Topics(ctx any) *gomock.Call

Topics indicates an expected call of Topics.

type MockMetrics

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

MockMetrics is a mock of Metrics interface.

func NewMockMetrics

func NewMockMetrics(ctrl *gomock.Controller) *MockMetrics

NewMockMetrics creates a new mock instance.

func (*MockMetrics) EXPECT

func (m *MockMetrics) EXPECT() *MockMetricsMockRecorder

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

func (*MockMetrics) IncrementCounter

func (m *MockMetrics) IncrementCounter(ctx context.Context, name string, labels ...string)

IncrementCounter mocks base method.

type MockMetricsMockRecorder

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

MockMetricsMockRecorder is the mock recorder for MockMetrics.

func (*MockMetricsMockRecorder) IncrementCounter

func (mr *MockMetricsMockRecorder) IncrementCounter(ctx, name any, labels ...any) *gomock.Call

IncrementCounter indicates an expected call of IncrementCounter.

type MockReader added in v1.28.2

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

MockReader is a mock of Reader interface.

func NewMockReader added in v1.28.2

func NewMockReader(ctrl *gomock.Controller) *MockReader

NewMockReader creates a new mock instance.

func (*MockReader) CreateTopic added in v1.28.2

func (m *MockReader) CreateTopic(ctx context.Context, topicID string) (*pubsub.Topic, error)

CreateTopic mocks base method.

func (*MockReader) EXPECT added in v1.28.2

func (m *MockReader) EXPECT() *MockReaderMockRecorder

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

func (*MockReader) Topic added in v1.28.2

func (m *MockReader) Topic(id string) *pubsub.Topic

Topic mocks base method.

type MockReaderMockRecorder added in v1.28.2

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

MockReaderMockRecorder is the mock recorder for MockReader.

func (*MockReaderMockRecorder) CreateTopic added in v1.28.2

func (mr *MockReaderMockRecorder) CreateTopic(ctx, topicID any) *gomock.Call

CreateTopic indicates an expected call of CreateTopic.

func (*MockReaderMockRecorder) Topic added in v1.28.2

func (mr *MockReaderMockRecorder) Topic(id any) *gomock.Call

Topic indicates an expected call of Topic.

type MockWriter added in v1.28.2

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

MockWriter is a mock of Writer interface.

func NewMockWriter added in v1.28.2

func NewMockWriter(ctrl *gomock.Controller) *MockWriter

NewMockWriter creates a new mock instance.

func (*MockWriter) CreateSubscription added in v1.28.2

func (m *MockWriter) CreateSubscription(ctx context.Context, id string, cfg pubsub.SubscriptionConfig) (*pubsub.Subscription, error)

CreateSubscription mocks base method.

func (*MockWriter) EXPECT added in v1.28.2

func (m *MockWriter) EXPECT() *MockWriterMockRecorder

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

func (*MockWriter) Subscription added in v1.28.2

func (m *MockWriter) Subscription(id string) *pubsub.Subscription

Subscription mocks base method.

type MockWriterMockRecorder added in v1.28.2

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

MockWriterMockRecorder is the mock recorder for MockWriter.

func (*MockWriterMockRecorder) CreateSubscription added in v1.28.2

func (mr *MockWriterMockRecorder) CreateSubscription(ctx, id, cfg any) *gomock.Call

CreateSubscription indicates an expected call of CreateSubscription.

func (*MockWriterMockRecorder) Subscription added in v1.28.2

func (mr *MockWriterMockRecorder) Subscription(id any) *gomock.Call

Subscription indicates an expected call of Subscription.

type Reader

type Reader interface {
	Topic(id string) *pubsub.Topic
	CreateTopic(ctx context.Context, topicID string) (*pubsub.Topic, error)
}

type Writer

type Writer interface {
	Subscription(id string) *pubsub.Subscription
	CreateSubscription(ctx context.Context, id string, cfg pubsub.SubscriptionConfig) (*pubsub.Subscription, error)
}

Jump to

Keyboard shortcuts

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