Documentation ¶
Index ¶
- Variables
- func AwsConfigFromContext(ctx context.Context) ([]*aws.Config, bool)
- func AwsContextConfigProvider(ctx context.Context) client.ConfigProvider
- func ErrBadRequest(msgs ...string) (*events.APIGatewayProxyResponse, error)
- func ErrInternalServerError(msgs ...string) (*events.APIGatewayProxyResponse, error)
- func ErrNotFound(msgs ...string) (*events.APIGatewayProxyResponse, error)
- func ErrNotImplemented(msgs ...string) (*events.APIGatewayProxyResponse, error)
- func ErrResponse(statusCode int, err error) (*events.APIGatewayProxyResponse, error)
- func ErrStringResponse(statusCode int, msgs ...string) (*events.APIGatewayProxyResponse, error)
- func NewAwsConfigContext(parentCtx context.Context, configs ...*aws.Config) context.Context
- func NewJSONAPIGatewayProxyResponse(statusCode int, headers map[string]string, bodyObj interface{}) (*events.APIGatewayProxyResponse, error)
- func SimpleOKResponse(result interface{}) (*events.APIGatewayProxyResponse, error)
- type ErrorResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultStatusMessages = map[int][]string{ http.StatusBadRequest: []string{"invalid request, please check your parameters and try again"}, http.StatusNotImplemented: []string{"not implemented"}, http.StatusInternalServerError: []string{"An error occurred on the server. Please report this error, an administrator will have to examine the logs to determine the cause of the error."}, http.StatusNotFound: []string{"not found"}, } )
Functions ¶
func AwsContextConfigProvider ¶
func AwsContextConfigProvider(ctx context.Context) client.ConfigProvider
func ErrBadRequest ¶
func ErrBadRequest(msgs ...string) (*events.APIGatewayProxyResponse, error)
func ErrInternalServerError ¶
func ErrInternalServerError(msgs ...string) (*events.APIGatewayProxyResponse, error)
func ErrNotFound ¶
func ErrNotFound(msgs ...string) (*events.APIGatewayProxyResponse, error)
func ErrNotImplemented ¶
func ErrNotImplemented(msgs ...string) (*events.APIGatewayProxyResponse, error)
func ErrResponse ¶
func ErrResponse(statusCode int, err error) (*events.APIGatewayProxyResponse, error)
func ErrStringResponse ¶
func ErrStringResponse(statusCode int, msgs ...string) (*events.APIGatewayProxyResponse, error)
func NewAwsConfigContext ¶
func NewJSONAPIGatewayProxyResponse ¶
func NewJSONAPIGatewayProxyResponse(statusCode int, headers map[string]string, bodyObj interface{}) (*events.APIGatewayProxyResponse, error)
NewJSONAPIGatewayProxyResponse builds a APIGatewayProxyResponse struct assuming the provided body can be marshaled into json as a map[string]interface{}
func SimpleOKResponse ¶
func SimpleOKResponse(result interface{}) (*events.APIGatewayProxyResponse, error)
Types ¶
type ErrorResponse ¶
ErrorResponse type is what we'll use to return error objects
func NewErrorResponse ¶
func NewErrorResponse(status int, msgs ...string) ErrorResponse
Click to show internal directories.
Click to hide internal directories.