Help us shape the future of Go! Take the 2026 Go Developer Survey

events

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 5 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	Request  *Request
	Defaults map[string]string
}

Params allows looking up parameters from Stage Variables, Path Parameters, and the Lambda environment variables

func (*Params) Lookup

func (p *Params) Lookup(name string) string

Lookup returns a value for the parameter, if it's set in an available field

type Request

Request aliases the API GW Request type

func (*Request) BodyAsParams

func (r *Request) BodyAsParams() (map[string]string, error)

BodyAsParams attempts to parse the request body as URL parameters

func (*Request) ToHTTP

func (r *Request) ToHTTP() (*http.Request, error)

ToHTTP returns the API Gateway request as an HTTP Request object

type Response

Response aliases the API GW Response type

func Fail

func Fail(msg string) (Response, error)

Fail returns a message with an HTTP 500

func Redirect

func Redirect(url string, code int) (Response, error)

Redirect returns a redirect to a new URL

func Reject

func Reject(msg string) (Response, error)

Reject returns a message with an HTTP 403

func Respond

func Respond(code int, msg string) (Response, error)

Respond builds a response with a given HTTP code and text message

func Succeed

func Succeed(msg string) (Response, error)

Succeed returns a message with an HTTP 200

Jump to

Keyboard shortcuts

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