pubsubio

package
v2.57.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 11 Imported by: 12

Documentation

Overview

Package pubsubio provides access to Pub/Sub on Dataflow streaming.

This implementation only functions on the Dataflow runner.

See https://cloud.google.com/dataflow/docs/concepts/streaming-with-cloud-pubsub for details on using Pub/Sub with Dataflow.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(s beam.Scope, project, topic string, opts *ReadOptions) beam.PCollection

Read reads an unbounded number of PubSubMessages from the given pubsub topic. It produces an unbounded PCollecton<*PubSubMessage>, if WithAttributes is set, or an unbounded PCollection<[]byte>.

func Write

func Write(s beam.Scope, project, topic string, col beam.PCollection)

Write writes PubSubMessages or []bytes to the given pubsub topic. Panics if the input pcollection type is not one of those two types.

When given []bytes, they are first wrapped in PubSubMessages.

Note: Doesn't function in batch pipelines.

Types

type ReadOptions

type ReadOptions struct {
	Subscription       string
	IDAttribute        string
	TimestampAttribute string
	WithAttributes     bool
}

ReadOptions represents options for reading from PubSub.

Jump to

Keyboard shortcuts

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