gcp

package
v0.0.0-...-7601700 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context) *pubsub.Client

Types

type PubSub

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

PubSub is a GCP PubSub client

func NewPubSub

func NewPubSub(pCtx context.Context, opts ...option.ClientOption) (*PubSub, error)

NewPubSub creates a new GCPPubSub instance.

func (*PubSub) CreateTopic

func (g *PubSub) CreateTopic(pCtx context.Context, topic string) error

CreateTopic creates a new topic

func (*PubSub) Publish

func (g *PubSub) Publish(pCtx context.Context, topicName string, message []byte, block bool) error

Publish publishes a message to a topic

func (*PubSub) Subscribe

func (g *PubSub) Subscribe(pCtx context.Context, topicName string, handler func(context.Context, []byte) error) error

Subscribe subscribes to a topic

Jump to

Keyboard shortcuts

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