cloudevents

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentType      = "application/cloudevents+json"
	CeContextKey     = "Lambda-Runtime-Cloudevents-Context"
	ClientContextKey = "Lambda-Runtime-Client-Context"
)

CloudEvents request constant attributes.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudEvent

type CloudEvent struct {
	// FunctionResponseMode describes what data is returned from the function:
	// only data payload or full event in binary format
	FunctionResponseMode string `envconfig:"function_response_mode" default:"data"`

	Overrides Overrides `envconfig:"overrides"`
}

CloudEvent is a data structure required to map KLR responses to cloudevents

func New

func New() (*CloudEvent, error)

func (*CloudEvent) ContentType

func (ce *CloudEvent) ContentType() string

func (*CloudEvent) Request added in v1.5.2

func (ce *CloudEvent) Request(request []byte, headers http.Header) ([]byte, map[string]string, error)

func (*CloudEvent) Response added in v1.5.2

func (ce *CloudEvent) Response(data []byte) ([]byte, error)

type Overrides added in v1.8.1

type Overrides struct {
	EventType string `envconfig:"type" default:"ce.klr.triggermesh.io"`
	Source    string `envconfig:"source" default:"knative-lambda-runtime"`
	Subject   string `envconfig:"subject" default:"klr-response"`
}

Jump to

Keyboard shortcuts

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