lambdautils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2019 License: GPL-2.0-or-later Imports: 9 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 AwsConfigFromContext

func AwsConfigFromContext(ctx context.Context) ([]*aws.Config, bool)

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 NewAwsConfigContext(parentCtx context.Context, configs ...*aws.Config) context.Context

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

type ErrorResponse struct {
	Status       string `json:"status"`
	ErrorMessage string `json:"error"`
}

ErrorResponse type is what we'll use to return error objects

func NewErrorResponse

func NewErrorResponse(status int, msgs ...string) ErrorResponse

Jump to

Keyboard shortcuts

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