apigateway

package
v0.0.0-...-b07ea14 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIGatewayEventUnmarshaler

type APIGatewayEventUnmarshaler func(event *apigatewayproxyevt.Event) (entity api.Entity, err error)

type APIGatewayResponse

type APIGatewayResponse struct {
	StatusCode    int               `json:"statusCode"`
	Headers       map[string]string `json:"headers"`
	Body          interface{}       `json:"body"`
	Base64Encoded bool              `json:"isBase64Encoded"`
}

func HandleCreate

func HandleCreate(evt *apigatewayproxyevt.Event, unmarshaler APIGatewayEventUnmarshaler, createFunc api.CreateFunc) (*APIGatewayResponse, error)

func HandleDelete

func HandleDelete(evt *apigatewayproxyevt.Event, deleteFunc api.DeleteFunc) (*APIGatewayResponse, error)

func HandleGet

func HandleGet(evt *apigatewayproxyevt.Event, getFunc api.GetFunc) (*APIGatewayResponse, error)

func HandleList

func HandleList(evt *apigatewayproxyevt.Event, listFunc api.ListFunc) (*APIGatewayResponse, error)

func HandleUpdate

func HandleUpdate(evt *apigatewayproxyevt.Event, unmarshaler APIGatewayEventUnmarshaler, updateFunc api.UpdateFunc) (*APIGatewayResponse, error)

func NewAPIGatewayResponse

func NewAPIGatewayResponse(status int) *APIGatewayResponse

func NewAPIGatewayResponseWithBody

func NewAPIGatewayResponseWithBody(status int, body interface{}) *APIGatewayResponse

func NewAPIGatewayResponseWithError

func NewAPIGatewayResponseWithError(status int, error error) *APIGatewayResponse

func (*APIGatewayResponse) SetBody

func (r *APIGatewayResponse) SetBody(b interface{})

SetBody checks to see if body implements json.Marshaler first If it does, it will use MarshalJSON() function. If not, defer back to json.MarshalIndent()

Jump to

Keyboard shortcuts

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