pubsub

package module
v0.3.1-0...-91063ab Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-msg-pubsub

Google Cloud Pub/Sub implementation of go-msg.

Documentation

Index

Constants

View Source
const (
	AttrMessageID          = "_ps_message_id"
	AttrMessagePublishTime = "_ps_message_publishtime"
)

These constants contain well-known keys for attributes.

View Source
const MessagePublishTimeFormat = time.RFC3339

MessagePublishTimeFormat is the round trip time format for the publish time attribute.

Variables

This section is empty.

Functions

func MessageID

func MessageID(atts msg.Attributes) string

MessageID returns the pub/sub ID of the original message.

func MessagePublishTime

func MessagePublishTime(atts msg.Attributes) time.Time

MessagePublishTime returns the pub/sub publish time of the original message.

func NewServer

func NewServer(ctx context.Context, projectID, subID, topicID string) (msg.Server, error)

NewServer returns a server implementation for Google's Cloud Pub/Sub.

Serve will only receive messages currently in the subscription and then exit. This is currently a limitation in the SDK for Cloud Pub/Sub Pull model. In the future Serve may instead iterate and add a sleep to emulate more of a Push model or support an HTTPS endpoint to use Pub/Sub's push.

Types

type Client

type Client interface {
	Topic(context.Context, string) (msg.Topic, error)
}

Client represents a concrete implementation of a pubsub publisher client.

func NewClient

func NewClient(ctx context.Context, projectID string) (Client, error)

NewClient returns a new instance of a pubsub Client for a given gcloud project.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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