gcppubsub

package
v0.0.0-...-8ee1375 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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