pubsub

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageHandler

type MessageHandler interface {
	OnMessage(*pubsub.Message) error
}

MessageHandler interface OnMessage function is what a subscriber will call. Any work done on a message should be done in the OnMessage function

type Publish

type Publish interface {
	Publish(message *ps.Message)
}

Publish interface intended to allow mocking of google Topic.Publish()

type PublishClient

type PublishClient struct {
	Context context.Context
	Topic   *ps.Topic
	Batch   bool
}

PublishClient settings for the Publisher

func (*PublishClient) Publish

func (pc *PublishClient) Publish(message *ps.Message)

Publish Publishes a message to the provided topic.

type SubscriberClient

type SubscriberClient struct {
	Subscritpion *pubsub.Subscription
	Context      context.Context
	Handler      MessageHandler
}

SubscriberClient Holdes the methods that will be used in the workers

func NewSubscriberClient

func NewSubscriberClient(ctx context.Context, s *pubsub.Subscription, mh MessageHandler) SubscriberClient

NewSubscriberClient initilizes a new subscriber to be uused in a worker.

Jump to

Keyboard shortcuts

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