events

package
v0.0.0-...-ba178a5 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FaasTimerEvent    = "faas.timer.event"
	FaasRocketMqEvent = "faas.rocketmq.event"
	FaasBmqEvent      = "faas.bmq.event"
	FaasKafkaEvent    = "faas.kafka.event"
	FaasTosEvent      = "faas.tos.event"
)

Supported CloudEvent types.

View Source
const (
	EventTypeAny = "any"

	// EventTypeHTTP represents http request from vefaas provided HTTP triggers (or other guys calling you with mesh http egress)
	EventTypeHTTP = "http"

	// EventTypeCloudEvent represents trigger events (timer/kafka/rocketmq/tos/abase_binlog, etc)
	EventTypeCloudEvent = "cloudevent"
)

Supported event type. When users call vefaas.Start(), we actually started a http web server. Incoming events/requests are simply just http request. We use headers (X-Faas-Event-Type) to determine whether this is a regular http request or a event trigger (timer trigger, tos trigger, etc).

Not intended to be used by regular vefaas-golang-runtime users. FaaS Native http users (running native http apps on vefaas) may want to use the value comparing with the X-Faas-Event-Type header, to determine if their request is coming from vefaas triggers.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudEvent

type CloudEvent struct {
	*cloudevents.Event
}

CloudEvent wraps cloudevents.

type EventResponse

type EventResponse struct {
	// StatusCode is supposed to be a valid HTTP Status code
	StatusCode int

	// Headers contains customized header returned from function.
	Headers map[string]string

	// Body just body, no surprise
	Body []byte
}

EventResponse represents the returned response from a vefaas-golang-runtime handler.

type HTTPRequest

type HTTPRequest struct {
	// Method
	HTTPMethod string

	// path, like /abc
	Path string

	// ip:port
	RemoteAddr string

	// parsed path params
	PathParameters map[string]string

	// parsed url query string params
	QueryStringParameters map[string]string

	// http headers
	Headers map[string]string

	// body in raw bytes
	Body []byte
}

HTTPRequest is a wrapper around net/http request, it's useful if users want to build web api using vefaas-golang-runtime handler.

Jump to

Keyboard shortcuts

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