google

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 11 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.

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 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 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