serverless

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 0 Imported by: 7

Documentation

Overview

Package serverless defines serverless handler context

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	// Data incoming data
	Data() []byte
	// Tag incoming tag
	Tag() uint32
	// Write writes data
	Write(tag uint32, data []byte) error
	// HTTP http interface
	HTTP() HTTP
	// WriteWithTarget writes data to sfn instance with specified target
	WriteWithTarget(tag uint32, data []byte, target string) error
}

Context sfn handler context

type CronContext added in v1.17.5

type CronContext interface {
	// Write writes data
	Write(tag uint32, data []byte) error
	// HTTP http interface
	HTTP() HTTP
	// WriteWithTarget writes data to sfn instance with specified target
	WriteWithTarget(tag uint32, data []byte, target string) error
}

CronContext sfn corn handler context

type HTTP added in v1.13.1

type HTTP interface {
	Send(req *HTTPRequest) (*HTTPResponse, error)
	Get(url string) (*HTTPResponse, error)
	Post(url string, contentType string, body []byte) (*HTTPResponse, error)
}

HTTP http interface

type HTTPRequest added in v1.13.1

type HTTPRequest struct {
	Method  string            // GET, POST, PUT, DELETE, ...
	URL     string            // https://example.org
	Header  map[string]string // {"Content-Type": "application/json"}
	Timeout int64             // timeout in milliseconds
	Body    []byte            // request body
}

HTTPRequest http request

type HTTPResponse added in v1.13.1

type HTTPResponse struct {
	Status     string            // "200 OK"
	StatusCode int               // 200, 404, ...
	Header     map[string]string // {"Content-Type": "application/json"}
	Body       []byte            // response body
}

HTTPResponse http response

Directories

Path Synopsis
guest wasm application programming interface for guest module
guest wasm application programming interface for guest module

Jump to

Keyboard shortcuts

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