gcppubsub

package
v0.0.0-...-7dfa3a9 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 4 modules, 4 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

This section is empty.

Variables

View Source
var ErrFailedToEstablishClient = errors.New("failed to establish pubsub client")

ErrFailedToEstablishClient indicates failure to create a Pub/Sub client.

View Source
var ErrFailedToPublishMessage = errors.New("failed to publish message")

ErrFailedToPublishMessage indicates failure to publish a message.

View Source
var ErrFailedToReceiveMessage = errors.New("failed to receive message")

ErrFailedToReceiveMessage indicates failure to receive messages.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, projectID string) (*Client, error)

NewClient creates a new Pub/Sub client. It automatically respects PUBSUB_EMULATOR_HOST env var.

func (*Client) Close

func (c *Client) Close() error

func (*Client) Publish

func (c *Client) Publish(ctx context.Context, topicID string, data []byte) (string, error)

func (*Client) Subscribe

func (c *Client) Subscribe(ctx context.Context, subID string,
	handler func(ctx context.Context, msgID string, data []byte) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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