pubsubsink

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PubsubClientGateway added in v0.14.1

type PubsubClientGateway interface {
	Topic(name string) topicGateway
	Close() error
}

PubSubClientGateway represents the gateway to a pubsub client.

func NewPubsubClientAdapter added in v0.14.1

func NewPubsubClientAdapter(client *pubsub.Client) PubsubClientGateway

NewPubSubClientAdapter creates a new PubsubClientGateway from a pubsub.Client

type Sink

type Sink struct {
	// contains filtered or unexported fields
}

Sink is a pubsub sink

func MustNew

func MustNew(client PubsubClientGateway) (sink *Sink, closeFunc func())

MustNew creates a new pubsub sink or panics if fails

func (*Sink) Store

func (s *Sink) Store(ctx context.Context, messages ...pipeline.SinkMessage) error

Store stores messages in a pubsub topic. It returns an error if any of the messages return an error.

type SinkMessage

type SinkMessage struct {
	Topic string
	Msg   []byte
}

SinkMessage is a message to be sent to a pubsub topic

Jump to

Keyboard shortcuts

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