pubsub

package
v0.0.0-...-e479ca6 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgeInSecMessage

func AgeInSecMessage(msg *pubsub.Message) float64

func CheckNbrItemsPubsub

func CheckNbrItemsPubsub(projectID string, subscriptionId string) (int64, error)

func PushElemToPubsub

func PushElemToPubsub(ctx *context.Context, topic *pubsub.Topic, elem *PubSubElement) error

func PushJsonStringToPubsub

func PushJsonStringToPubsub(ctx *context.Context, topic *pubsub.Topic, jsonString string) error

func ReceiveEventsFromPubsub

func ReceiveEventsFromPubsub(
	devprod string,
	projectId string,
	subscriptionId string,
	minAgeSecs int,
	nbrAckWorker int,
	maxPollPerRun int,
	pubsubForwardChan *chan *PubSubElement) (int, error)

ReceiveEventsFromPubsub is synchronous in it's nature. It will lock up main thread. Do not call until main pipeline is setup or it might deadlock if the buffered chan gets full.

func SetupClientAndTopic

func SetupClientAndTopic(projectID string, topicId string) (*context.Context, *pubsub.Client, *pubsub.Topic, error)

Types

type PubSubElement

type PubSubElement struct {
	CompanyID     int
	ESP           string
	ESPJsonString string
	Ts            int64
	SafeHash      string
	Sign          string // Sign hash where applicable
	Dest          string // added here in fanout.
}

type PubSubMessage

type PubSubMessage struct {
	Data []byte `json:"data"`
}

Jump to

Keyboard shortcuts

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