Documentation ¶
Overview ¶
Package publish contains utilities related to publishing messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct { // The topic partition the message was published to. Partition int // The offset the message was assigned. Offset int64 }
Metadata holds the result of publishing a message to the Pub/Sub Lite service.
func ParseMetadata ¶
ParseMetadata converts the ID string of a pubsub.PublishResult to Metadata.
Example:
result := publisher.Publish(ctx, &pubsub.Message{Data: []byte("payload")}) id, err := result.Get(ctx) if err != nil { // TODO: Handle error. } metadata, err := publish.ParseMetadata(id) if err != nil { // TODO: Handle error. }
Click to show internal directories.
Click to hide internal directories.