handler

package module
v0.0.0-...-1117c25 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

README

go-function-sdk

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Options map[string]string
}

Configuration options for a Request

type FunctionHandler

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

FunctionHandler used for a serverless Go method invocation

type Request

type Request struct {
	Alert       template.Alert
	Config      Configuration
	Header      http.Header
	QueryString string
	Method      string
}

Request of remediation 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