lambdagateway

package
v0.0.0-...-7a2dd3a Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizerError

type AuthorizerError struct {
	Message        string                                 `json:"message"`
	RequestContext *events.APIGatewayV2HTTPRequestContext `json:"request_context"`
}

func (*AuthorizerError) Error

func (e *AuthorizerError) Error() string

type Error

type Error interface {
	Error() string
	// contains filtered or unexported methods
}

func ClientError

func ClientError(statusCode int, errorMessage string) Error

func ServerError

func ServerError() Error

type ErrorDecodeError

type ErrorDecodeError struct {
	OriginalErrorMessage *ErrorMessage `json:"original_error_message"`
	Err                  error         `json:"err"`
}

func (*ErrorDecodeError) Error

func (e *ErrorDecodeError) Error() string

type ErrorMessage

type ErrorMessage struct {
	ErrorType    string `json:"error_type"`
	ErrorMessage string `json:"error_message"`
}

type Gateway

type Gateway struct {
	// contains filtered or unexported fields
}

func NewLambdaGateway

func NewLambdaGateway(
	lambdaClient *lambda.Lambda,
	opts ...GatewayOption,
) *Gateway

func (*Gateway) Serve

func (s *Gateway) Serve(ctx context.Context, req *Request) (*Response, error)

type GatewayOption

type GatewayOption func(*Gateway)

func AddFunction

func AddFunction(path, method, lambdaArn string, id string) GatewayOption

func SetBasePath

func SetBasePath(basePath string) GatewayOption

func SetFunctionErrorHandler

func SetFunctionErrorHandler(h func(*LambdaError) error) GatewayOption

func SetLogger

func SetLogger(logger Logger) GatewayOption

func WithAPIRequestID

func WithAPIRequestID(apiRequestIdField string) GatewayOption

func WithClaimSubID

func WithClaimSubID(field string) GatewayOption

type LambdaError

type LambdaError struct {
	ErrorType    string `json:"errorType"`
	ErrorMessage string `json:"errorMessage"`
}

func (*LambdaError) Error

func (e *LambdaError) Error() string

type Logger

type Logger interface {
	Error(msg string, err error)
}

Jump to

Keyboard shortcuts

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