lambda_common

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

README

lambda-common

Simple set of go modules that can be used with aws lambda development

Documentation

Index

Constants

View Source
const (
	ErrorFailedToUnmarshal  = 100
	ErrorFailedToMarshal    = 200
	ErrorFailedToHashSecret = 300
)

Variables

This section is empty.

Functions

func CreateResponseError

func CreateResponseError(e error) (events.APIGatewayProxyResponse, error)

func GenerateSecretHash added in v1.2.0

func GenerateSecretHash(username, clientId, clientSecret string) (string, error)

func LogRequest added in v1.2.0

func LogRequest(event events.APIGatewayProxyRequest)

func LogRequestPretty added in v1.2.0

func LogRequestPretty(event events.APIGatewayProxyRequest)

func MarshalResponse added in v1.2.0

func MarshalResponse(payload any) (string, error)

func UnmarshalRequest added in v1.2.0

func UnmarshalRequest(req events.APIGatewayProxyRequest, payload any) error

Types

type ApiError

type ApiError struct {
	Id         int
	Body       ApiErrorBody
	Err        error
	StatusCode int
}

func CreateApiError

func CreateApiError(id int, status int, message string, err error) ApiError

func (ApiError) Error

func (e ApiError) Error() string

type ApiErrorBody

type ApiErrorBody struct {
	Id         int
	Message    string
	StatusCode int
}

type ApiSuccess added in v1.3.0

type ApiSuccess struct {
	Message    string `json:"message"`
	StatusCode int    `json:"status"`
}

Jump to

Keyboard shortcuts

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