pubsub

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTopicFromRequestPath

func ExtractTopicFromRequestPath(path string) (string, error)

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

Types

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 (https://cloud.google.com/functions/docs/calling/pubsub#legacy_cloud_pubsub_triggers). This matched the event payload that is sent by Pub/Sub to HTTP push subscription endpoints (https://cloud.google.com/pubsub/docs/push#receiving_messages).

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 {
	pubsub.Message
	// The pubsub libary's Message.Id field (https://pkg.go.dev/cloud.google.com/go/internal/pubsub#Message)
	// doesn't have the correct JSON tag (it serializes to "id" instead of
	// "messageId"), so use this field to capture the JSON field with key
	// "messageId".
	IdFromJSON string `json:"messageId"`
}

Message is a pubsub.Message but with the correct JSON tag for the message ID field that matches https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage

Jump to

Keyboard shortcuts

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