rambda

package module
v0.0.0-...-25de52f Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 5 Imported by: 0

README

rambda

simple lambda proxy response wrappers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHeaders

func DefaultHeaders() *string

DefaultHeaders - provide sane defaults for rest api headers

func DefaultMethods

func DefaultMethods() *string

DefaultMethods - provide sane defaults for rest api methods

func RespondBadRequest

func RespondBadRequest(message string, headers map[string]string) events.APIGatewayProxyResponse

RespondBadRequest - respond bad request

func RespondConflict

func RespondConflict(message string, headers map[string]string) events.APIGatewayProxyResponse

RespondConflict - respond conflict

func RespondCreated

func RespondCreated(message string, headers map[string]string) events.APIGatewayProxyResponse

RespondCreated - respond created

func RespondForbidden

func RespondForbidden(message string, headers map[string]string) events.APIGatewayProxyResponse

func RespondGenericServer

func RespondGenericServer(message string, headers map[string]string) events.APIGatewayProxyResponse

RespondGenericServer - respond generic error

func RespondJSONWith

func RespondJSONWith(status int, payload interface{}, headers map[string]string) (events.APIGatewayProxyResponse, error)

RespondJSONWith - api gateway proxy response

func RespondNotFound

func RespondNotFound(message string, headers map[string]string) events.APIGatewayProxyResponse

RespondNotFound - respond not found

func RespondOK

func RespondOK(message string, headers map[string]string) events.APIGatewayProxyResponse

RespondOK - respond ok

func RespondUnAuthorised

func RespondUnAuthorised(message string, headers map[string]string) events.APIGatewayProxyResponse

func SetDefaultHeaders

func SetDefaultHeaders(headers map[string]string)

SetDefaultHeaders - set default headers that are applied to all lambda responses

Types

type Envelope

type Envelope map[string]interface{}

type EnvelopeError

type EnvelopeError struct {
	Title    string `json:"title,omitempty"`
	Detail   string `json:"detail,omitempty"`
	Envelope `json:"-"`
}

func (EnvelopeError) MarshalJSON

func (e EnvelopeError) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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