pubsub

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Message

type Message struct {
	Data        []byte
	Attributes  map[string]string
	OrderingKey string
}

type PubSubPublisher

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

PubSubPublisher is a publisher for Google Cloud Pub/Sub.

func NewPublisher

func NewPublisher(ctx context.Context, cfg *config.PubSub) (*PubSubPublisher, error)

NewPublisher creates a new publisher.

func (*PubSubPublisher) AsyncPublish

func (p *PubSubPublisher) AsyncPublish(ctx context.Context, msg Message) PublishResult

Publish publishes a message to the topic.

func (*PubSubPublisher) Close

func (p *PubSubPublisher) Close() error

Close closes the publisher.

type PublishResult added in v0.0.5

type PublishResult interface {
	Ready() <-chan struct{}
	Get(ctx context.Context) (serverID string, err error)
}

PublishResult is an interface for pubsub.PublishResult.

type Publisher

type Publisher interface {
	AsyncPublish(ctx context.Context, msg Message) PublishResult
}

Pulisher is an interface for PubSub Publisher.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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