pubsub

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package pubsub handles interactions with PubSub framework.

Index

Constants

This section is empty.

Variables

View Source
var ErrorInParse = errors.New("error during protojson.Unmarshal")

ErrorInParse indicates there was an error while unmarshalling the protocol buffer message.

Functions

This section is empty.

Types

type Publisher

type Publisher interface {
	Publish(request *data.ScorecardBatchRequest) error
	Close() error
}

Publisher interface is used to publish cron job requests to PubSub.

func CreatePublisher

func CreatePublisher(ctx context.Context, topicURL string) (Publisher, error)

CreatePublisher returns an implementation of the Publisher interface.

type Subscriber

type Subscriber interface {
	SynchronousPull() (*data.ScorecardBatchRequest, error)
	Ack()
	Nack()
	Close() error
}

Subscriber interface is used pull messages from PubSub.

func CreateSubscriber

func CreateSubscriber(ctx context.Context, subscriptionURL string) (Subscriber, error)

CreateSubscriber returns an implementation of Subscriber interface. Currently returns an instance of gcsSubscriber.

Jump to

Keyboard shortcuts

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