apigateway

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package apigateway provides a standard serialization format to wrap API Gateway responses that translate into specific end-user errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int                    `json:"code"`
	Err     string                 `json:"err"`
	Message string                 `json:"message"`
	Context map[string]interface{} `json:"context,omitempty"`
}

Error represents an error to return in response to an API Gateway request

func NewErrorResponse

func NewErrorResponse(statusCode int, messages ...string) *Error

NewErrorResponse returns a response that satisfies the regular expression used to determine integration mappings via the API Gateway

func (*Error) Error

func (apigError *Error) Error() string

Error returns the JSONified version of this error which will trigger the appropriate integration mapping.

Jump to

Keyboard shortcuts

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