pubsub

package
v0.0.0-...-adf2f75 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSubscriptionIDPrefix string = "nuclio-pub"

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	trigger.Configuration
	Subscriptions []Subscription
	ProjectID     string
	AckDeadline   string
	Credentials   trigger.Secret
	NoCredentials bool
}

func NewConfiguration

func NewConfiguration(id string,
	triggerConfiguration *functionconfig.Trigger,
	runtimeConfiguration *runtime.Configuration) (*Configuration, error)

type Event

type Event struct {
	nuclio.AbstractEvent
	// contains filtered or unexported fields
}

Event stores a whole pubsub message

func (*Event) GetBody

func (e *Event) GetBody() []byte

GetBody returns a message data

func (*Event) GetHeader

func (e *Event) GetHeader(key string) interface{}

GetHeader returns the header by name as an interface{}

func (*Event) GetHeaderByteSlice

func (e *Event) GetHeaderByteSlice(key string) []byte

GetHeaderByteSlice returns the header by name as a byte slice

func (*Event) GetHeaderString

func (e *Event) GetHeaderString(key string) string

GetHeaderString returns the header by name as a string

func (*Event) GetHeaders

func (e *Event) GetHeaders() map[string]interface{}

GetHeaders loads all headers into a map of string / interface{}

func (*Event) GetPath

func (e *Event) GetPath() string

GetPath returns the path of the event

func (*Event) GetSize

func (e *Event) GetSize() int

GetSize returns data length

func (*Event) GetURL

func (e *Event) GetURL() string

GetURL returns the URL of the event

type Subscription

type Subscription struct {
	Topic       string
	IDPrefix    string
	Shared      bool
	AckDeadline string
	SkipCreate  bool

	// https://godoc.org/cloud.google.com/go/pubsub#ReceiveSettings
	MaxNumWorkers int
	Synchronous   bool
}

Jump to

Keyboard shortcuts

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