pubsub

package
v0.0.90 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendGCS

func SendGCS(ctx context.Context, log logrus.FieldLogger, client *pubsub.Client, projectID, subID string, settings *pubsub.ReceiveSettings, receivers chan *Notification) error

SendGCS converts GCS pubsub messages into Notification structs and sends them to receivers.

Connects to the specified subscription with optionally specified settings. Receives pubsub messages from this subscription and converts it into a Notification struct.

  • Nacks any message it cannot parse.

Sends the notification to the receivers channel.

  • Nacks messages associated with any unsent Notifications.
  • Acks as soon as the Notification is sent.

Types

type Event

type Event string
const (
	Finalize Event = "OBJECT_FINALIZE"
	Delete   Event = "OBJECT_DELETE"
)

type Notification

type Notification struct {
	Path       gcs.Path
	Event      Event
	Time       time.Time
	Generation int64
}

func (Notification) String

func (n Notification) String() string

Jump to

Keyboard shortcuts

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