pubsub

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

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package pubsub provides Google Pub/Sub related implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PubSub

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

PubSub represents the PubSub (client).

func New

func New(ctx context.Context, projectID string, opts ...option.ClientOption) (*PubSub, error)

New constructs new PubSub.

func (*PubSub) Close

func (p *PubSub) Close() error

Close the connection with server.

func (*PubSub) EnsureSubscription

func (p *PubSub) EnsureSubscription(ctx context.Context, topic *pubsub.Topic, id string) (*pubsub.Subscription, error)

EnsureSubscription ensures the subscription exists.

func (*PubSub) EnsureTopic

func (p *PubSub) EnsureTopic(ctx context.Context, id string) (*pubsub.Topic, error)

EnsureTopic ensures the topic exists.

func (*PubSub) Publish

func (p *PubSub) Publish(topicID string, msg []byte) mq.PublishResult

Publish message to specific topic.

func (*PubSub) Subscribe

func (p *PubSub) Subscribe(ctx context.Context, channel string, h mq.Handler) error

Subscribe to specific channel.

Jump to

Keyboard shortcuts

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