gcp

package
v0.0.0-...-69af3c4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// WithProjectID sets the project ID for pubsub transport.
	WithProjectID = pubsub.WithProjectID

	// WithTopicID sets the topic ID for pubsub transport.
	WithTopicID = pubsub.WithTopicID
)
View Source
var (
	// NewEvent returns a new Event, an optional version can be passed to change the
	// default spec version from 1.0 to the provided version.
	NewEvent = event.New

	// NewMessage returns a binding.Message with header and data.
	// The returned binding.Message *cannot* be read several times. In order to read it more times, buffer it using binding/buffering methods
	NewMessage = http.NewMessage

	// MessageFromEvent converts an event to a message.
	MessageFromEvent = binding.ToMessage

	// MessageWriteRequest write the message to a request.
	MessageWriteRequest = http.WriteRequest
)

Functions

func Decoder

func Decoder(kind PayloadType) func(http.Handler) http.Handler

Decoder adapts the request as a different format

func NewClient

func NewClient(opts ...Option) (v2.Client, error)

NewClient creates a new pub-sub client

Types

type Event

type Event = event.Event

Event represents the canonical representation of a CloudEvent.

func NewStorageEvent

func NewStorageEvent(name string, data *storage.StorageObjectData) (*Event, error)

NewStorageEvent creates a new storage event

type Option

type Option = pubsub.Option

Option is the function signature required to be considered an pubsub.Option.

type PayloadType

type PayloadType byte
const (
	// PayloadTypeNone represents the No Op decoder
	PayloadTypeNone PayloadType = iota
	// PayloadTypeQueue represents the Queue decoder
	PayloadTypeQueue
	// PayloadTypeStorage represents the Storage decoder
	PayloadTypeStorage
)

type Protocol

type Protocol = pubsub.Protocol

Protocol is the pubsub.Protocol

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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