Version: v1.6.0 Latest Latest

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0



Package pubsub contains utilities for handling Google Cloud Pub/Sub events.



This section is empty.


This section is empty.


func ExtractTopicFromRequestPath

func ExtractTopicFromRequestPath(path string) (string, error)

ExtractTopicFromRequestPath extracts a Pub/Sub topic from a URL request path.


type LegacyPushSubscriptionEvent

type LegacyPushSubscriptionEvent struct {
	Subscription string `json:"subscription"`
	Message      `json:"message"`

LegacyPushSubscriptionEvent is the event payload for legacy Cloud Pub/Sub push subscription triggers ( This matched the event payload that is sent by Pub/Sub to HTTP push subscription endpoints (

func (*LegacyPushSubscriptionEvent) ToBackgroundEvent

func (e *LegacyPushSubscriptionEvent) ToBackgroundEvent(topic string) *fftypes.BackgroundEvent

ToBackgroundEvent converts the event to the standard BackgroundEvent format for Background Functions.

type Message

type Message struct {
	// ID identifies this message.
	// This ID is assigned by the server and is populated for Messages obtained from a subscription.
	// This field is read-only.
	ID string `json:"messageId"`

	// Data is the actual data in the message.
	Data []byte `json:"data"`

	// Attributes represents the key-value pairs the current message
	// is labelled with.
	Attributes map[string]string `json:"attributes"`

	// The time at which the message was published.
	// This is populated by the server for Messages obtained from a subscription.
	// This field is read-only.
	PublishTime time.Time `json:"publishTime"`

Message represents a Pub/Sub message.

Source Files

Jump to

Keyboard shortcuts

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