handler

package module
v0.0.0-...-f4d7ef3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: MIT Imports: 1 Imported by: 3

README

go-function-sdk

An SDK for building functions in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FunctionHandler

type FunctionHandler interface {
	Handle(req Request) (Response, error)
}

FunctionHandler used for a serverless Go method invocation

type Request

type Request struct {
	Body        []byte
	Header      http.Header
	QueryString string
	Method      string
	Host        string
}

Request of function call

type Response

type Response struct {

	// Body the body will be written back
	Body []byte

	// StatusCode needs to be populated with value such as http.StatusOK
	StatusCode int

	// Header is optional and contains any additional headers the function response should set
	Header http.Header
}

Response of function call

Jump to

Keyboard shortcuts

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