google

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

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

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) Close

func (m *MockClient) Close() error

Close mocks base method.

func (*MockClient) CreateSubscription

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

CreateSubscription mocks base method.

func (*MockClient) CreateTopic

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

CreateTopic mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

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

func (*MockClient) Subscription

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

Subscription mocks base method.

func (*MockClient) Subscriptions

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

Subscriptions mocks base method.

func (*MockClient) Topic

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

Topic mocks base method.

func (*MockClient) Topics

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

Topics mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) Close

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

Close indicates an expected call of Close.

func (*MockClientMockRecorder) CreateSubscription

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

CreateSubscription indicates an expected call of CreateSubscription.

func (*MockClientMockRecorder) CreateTopic

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

CreateTopic indicates an expected call of CreateTopic.

func (*MockClientMockRecorder) Subscription

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

Subscription indicates an expected call of Subscription.

func (*MockClientMockRecorder) Subscriptions

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

Subscriptions indicates an expected call of Subscriptions.

func (*MockClientMockRecorder) Topic

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

Topic indicates an expected call of Topic.

func (*MockClientMockRecorder) Topics

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

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

MockReader is a mock of Reader interface.

func NewMockReader

func NewMockReader(ctrl *gomock.Controller) *MockReader

NewMockReader creates a new mock instance.

func (*MockReader) CreateTopic

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

CreateTopic mocks base method.

func (*MockReader) EXPECT

func (m *MockReader) EXPECT() *MockReaderMockRecorder

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

func (*MockReader) Topic

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

Topic mocks base method.

type MockReaderMockRecorder

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

MockReaderMockRecorder is the mock recorder for MockReader.

func (*MockReaderMockRecorder) CreateTopic

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

CreateTopic indicates an expected call of CreateTopic.

func (*MockReaderMockRecorder) Topic

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

Topic indicates an expected call of Topic.

type MockWriter

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

MockWriter is a mock of Writer interface.

func NewMockWriter

func NewMockWriter(ctrl *gomock.Controller) *MockWriter

NewMockWriter creates a new mock instance.

func (*MockWriter) CreateSubscription

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

CreateSubscription mocks base method.

func (*MockWriter) EXPECT

func (m *MockWriter) EXPECT() *MockWriterMockRecorder

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

func (*MockWriter) Subscription

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

Subscription mocks base method.

type MockWriterMockRecorder

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

MockWriterMockRecorder is the mock recorder for MockWriter.

func (*MockWriterMockRecorder) CreateSubscription

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

CreateSubscription indicates an expected call of CreateSubscription.

func (*MockWriterMockRecorder) Subscription

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