Documentation ¶
Index ¶
- Constants
- func AddRequestIDToHeaders(requestID *string, responseHeaders map[string]string, ...)
- func FindHeaderValue(headers map[string]string, key string) string
- func GetRecord(s3Client *s3.ClientWithHelpers, bucket string, message events.SQSMessage, ...) (interface{}, error)
- func RequestIDFromHeaders(headers map[string]string, requestIDHeaderKey string) *string
- func RequestIDFromLambdaContext(ctx context.Context) *string
- func ServeHTTPFunctions(ctx context.Context, lambdaHandler lambda.Handler, w http.ResponseWriter, ...)
- func ServeSQSFunctions(ctx context.Context, lambdaHandler lambda.Handler, w http.ResponseWriter, ...)
- func SignAWSHttpRequest(request *http.Request, accessKeyID, secretAccessKey string, ...) error
- func SignAWSRestyClient(client *resty.Client, accessKeyID, secretAccessKey string, bodyBytes []byte) error
- func ValidateAPIEndpoints(endpoints map[string]map[string]interface{}) (map[string]map[string]interface{}, error)
- func ValidateCronHandlers(handlers map[string]func() error) (map[string]func() error, error)
- func ValidateRequestParams(request *events.APIGatewayProxyRequest, paramsStructType reflect.Type) (reflect.Value, error)
- func ValidateSQSEndpoints(endpoints map[string]interface{}) (map[string]interface{}, error)
- func ValidateWebsocketEndpoints(endpoints map[string]interface{}) (map[string]interface{}, error)
- type Handler
- type IValidator
- type SQSHandler
Constants ¶
const HTTPXRequestIDHeaderKey = "X-Request-ID"
Variables ¶
This section is empty.
Functions ¶
func AddRequestIDToHeaders ¶
func FindHeaderValue ¶ added in v1.91.0
func GetRecord ¶
func GetRecord(s3Client *s3.ClientWithHelpers, bucket string, message events.SQSMessage, recordType reflect.Type) (interface{}, error)
func RequestIDFromHeaders ¶
func ServeHTTPFunctions ¶ added in v1.102.0
func ServeSQSFunctions ¶ added in v1.102.0
func SignAWSHttpRequest ¶ added in v1.75.0
func SignAWSHttpRequest(request *http.Request, accessKeyID, secretAccessKey string, bodySeeker io.ReadSeeker) error
SignAWSRequest wraps and executes http.NewRequest and adds a sig version 4 signature for AWS API Gateway
func SignAWSRestyClient ¶ added in v1.75.0
func ValidateAPIEndpoints ¶
func ValidateAPIEndpoints(endpoints map[string]map[string]interface{}) (map[string]map[string]interface{}, error)
ValidateAPIEndpoints checks that all API endpoints are correctly defined using one of the supported handler types return updated endpoints with additional information
func ValidateCronHandlers ¶
ValidateCronHandlers checks that all handlers are correctly defined using one of the supported handler types return updated handlers (with additional information -> N/A for cron)
func ValidateRequestParams ¶
func ValidateSQSEndpoints ¶
ValidateSQSEndpoints checks that all SQS endpoints are correctly defined using one of the supported handler types return updated endpoints with additional information
func ValidateWebsocketEndpoints ¶ added in v1.219.0
ValidateWebsocketEndpoints checks that all websocket endpoints are correctly defined using one of the supported handler types and returns updated endpoints with additional information
Types ¶
type Handler ¶
type Handler struct { RequestParamsType reflect.Type RequestBodyType reflect.Type ResponseType reflect.Type FuncValue reflect.Value }
func NewHandler ¶
type IValidator ¶
type IValidator interface {
Validate() error
}
type SQSHandler ¶
func NewSQSHandler ¶
func NewSQSHandler(fnc interface{}) (SQSHandler, error)