pubsub

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidTopic = errors.New("pubsub: invalid topic")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*pubsub.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, project string, opts ...Option) (*Client, error)

func (*Client) CreatePublisher

func (c *Client) CreatePublisher(topic string, opts ...PublishOption) (publisher.Publisher, error)

func (*Client) CreatePublisherInProject

func (c *Client) CreatePublisherInProject(topic, project string, opts ...PublishOption) (publisher.Publisher, error)

func (*Client) CreatePuller

func (c *Client) CreatePuller(subscription, topic string, opts ...ReceiveOption) (puller.Puller, error)

func (*Client) DeleteSubscription added in v0.4.0

func (c *Client) DeleteSubscription(id string) error

func (*Client) DeleteSubscriptionIfExist added in v0.4.0

func (c *Client) DeleteSubscriptionIfExist(id string) error

func (*Client) SubscriptionExists added in v0.4.0

func (c *Client) SubscriptionExists(id string) (bool, error)

type Option

type Option func(*options)

func WithBackoff

func WithBackoff(bf backoff.Backoff) Option

func WithLogger

func WithLogger(l *zap.Logger) Option

func WithMetrics

func WithMetrics(registerer metrics.Registerer) Option

func WithRetries

func WithRetries(retries int) Option

type PublishOption

type PublishOption func(*publishOptions)

func WithPublishNumGoroutines

func WithPublishNumGoroutines(n int) PublishOption

func WithPublishTimeout

func WithPublishTimeout(timeout time.Duration) PublishOption

type ReceiveOption

type ReceiveOption func(*receiveOptions)

func WithMaxExtension

func WithMaxExtension(d time.Duration) ReceiveOption

func WithMaxOutstandingBytes

func WithMaxOutstandingBytes(b int) ReceiveOption

func WithMaxOutstandingMessages

func WithMaxOutstandingMessages(n int) ReceiveOption

func WithNumGoroutines

func WithNumGoroutines(n int) ReceiveOption

Directories

Path Synopsis
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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