pubsub

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGooglePubSub

func NewGooglePubSub(config config.MQConfig, logger zerolog.Logger) (mq.MQ, error)

NewGooglePubSub returns a mq.MQ implement with google pubsub

Types

type GooglePubSub

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

GooglePubSub implements methods of MQ through google pub/sub

func (*GooglePubSub) InitSubscriber

func (googlepubsub *GooglePubSub) InitSubscriber(ctx context.Context, projectID, topicID string, subIDs ...string) error

func (*GooglePubSub) InitTopic

func (googlepubsub *GooglePubSub) InitTopic(ctx context.Context, projectID, topicID string) error

func (*GooglePubSub) Publish

func (googlepubsub *GooglePubSub) Publish(distributedID int64, projectID, topicID string, message []byte) error

func (*GooglePubSub) Stop

func (googlepubsub *GooglePubSub) Stop()

func (*GooglePubSub) Subscribe

func (googlepubsub *GooglePubSub) Subscribe(projectID, subscription string, process func(context.Context, []byte) error) error

type Receiver added in v1.0.1

type Receiver struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewReceiver added in v1.0.1

func NewReceiver(subscription *pubsub.Subscription,
	process func(context.Context, []byte) error,
	logger zerolog.Logger,
	stopTimeout time.Duration) *Receiver

func (*Receiver) Start added in v1.0.1

func (receiver *Receiver) Start(ctx context.Context) *Receiver

func (*Receiver) Stop added in v1.0.1

func (receiver *Receiver) Stop()

Jump to

Keyboard shortcuts

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