Documentation ¶
Index ¶
- Constants
- Variables
- func APIGatewayCustomAuthorizerHandler(h APIGatewayCustomAuthorizerHandlerFunc, conf HandlerConfig) ...
- func APIGatewayCustomAuthorizerHandlerWithNewRelic(h APIGatewayCustomAuthorizerHandlerFunc, conf HandlerConfig) lambda.Handler
- func APIGatewayProxyHandler(h APIGatewayProxyHandlerFunc, conf HandlerConfig) func(context.Context, events.APIGatewayProxyRequest) (any, error)
- func APIGatewayProxyHandlerWithNewRelic(h APIGatewayProxyHandlerFunc, conf HandlerConfig) lambda.Handler
- func CloudWatchHandler(h CloudWatchHandlerFunc, conf HandlerConfig) func(context.Context, events.CloudWatchEvent) (LambdaResult, error)
- func CloudWatchHandlerWithNewRelic(h CloudWatchHandlerFunc, conf HandlerConfig) lambda.Handler
- func DynamoDbHandler(h DynamoHandlerFunc, conf HandlerConfig) func(context.Context, events.DynamoDBEvent) error
- func DynamoDbHandlerWithNewRelic(h DynamoHandlerFunc, conf HandlerConfig) lambda.Handler
- func LambdaAdapter(l LambdaHandler) func(http.ResponseWriter, *http.Request)
- func NewAuthorizerResponse() events.APIGatewayCustomAuthorizerResponse
- func NewHTTPHandler(lambdaEndpoints LambdaHandlerEndpoints, portNumber int)
- func S3Handler(h S3HandlerFunc, conf HandlerConfig) func(context.Context, events.S3Event) error
- func S3HandlerWithNewRelic(h S3HandlerFunc, conf HandlerConfig) lambda.Handler
- func SQSHandler(h SQSHandlerFunc, conf HandlerConfig) func(context.Context, events.SQSEvent) error
- func SQSHandlerWithNewRelic(h SQSHandlerFunc, conf HandlerConfig) lambda.Handler
- func StepHandler(h StepHandlerFunc, conf HandlerConfig) func(context.Context, StepEvent) (StepEvent, error)
- func StepHandlerWithNewRelic(h StepHandlerFunc, conf HandlerConfig) lambda.Handler
- type APIGatewayCustomAuthorizerContext
- func (c *APIGatewayCustomAuthorizerContext) AddNewRelicAttribute(key string, val interface{})
- func (c *APIGatewayCustomAuthorizerContext) AllowAllMethods()
- func (c *APIGatewayCustomAuthorizerContext) AllowMethod(verb, resource string)
- func (c *APIGatewayCustomAuthorizerContext) DenyAllMethods()
- func (c *APIGatewayCustomAuthorizerContext) DenyMethod(verb, resource string)
- func (c *APIGatewayCustomAuthorizerContext) SetPrincipalID(principalID string)
- type APIGatewayCustomAuthorizerHandlerFunc
- type APIGatewayProxyContext
- func (c *APIGatewayProxyContext) AddNewRelicAttribute(key string, val interface{})
- func (c *APIGatewayProxyContext) Bind(v interface{}) error
- func (c *APIGatewayProxyContext) GetCookie(name string) (http.Cookie, bool)
- func (c *APIGatewayProxyContext) GetHeader(name string) string
- func (c *APIGatewayProxyContext) JSON(statusCode int, body interface{}) error
- type APIGatewayProxyHandlerFunc
- type CloudWatchContext
- type CloudWatchHandlerFunc
- type DynamoDbContext
- type DynamoHandlerFunc
- type Effect
- type Err
- type HandlerConfig
- type LambdaHandler
- type LambdaHandlerEndpoints
- type LambdaResult
- type S3Context
- type S3HandlerFunc
- type SQSContext
- type SQSHandlerFunc
- type SQSMessageEnvelope
- type SQSMessageMeta
- type StepContext
- type StepEvent
- type StepHandlerFunc
- type Validatable
Constants ¶
View Source
const ( WelcomeMessage = "G8 HTTP server is running on port" UnhandledErrMessage = "unhandled error: " )
View Source
const All = "*"
Variables ¶
View Source
var ErrInternalServer = Err{ Status: http.StatusInternalServerError, Code: "INTERNAL_SERVER_ERROR", Detail: "Internal server error", }
View Source
var ErrInvalidBody = Err{ Status: http.StatusBadRequest, Code: "INVALID_REQUEST_BODY", Detail: "Invalid request body", }
Functions ¶
func APIGatewayCustomAuthorizerHandler ¶ added in v0.1.4
func APIGatewayCustomAuthorizerHandler( h APIGatewayCustomAuthorizerHandlerFunc, conf HandlerConfig, ) func(context.Context, events.APIGatewayCustomAuthorizerRequestTypeRequest) (events.APIGatewayCustomAuthorizerResponse, error)
APIGatewayCustomAuthorizerHandler fd
func APIGatewayCustomAuthorizerHandlerWithNewRelic ¶ added in v0.1.4
func APIGatewayCustomAuthorizerHandlerWithNewRelic(h APIGatewayCustomAuthorizerHandlerFunc, conf HandlerConfig) lambda.Handler
func APIGatewayProxyHandler ¶
func APIGatewayProxyHandler( h APIGatewayProxyHandlerFunc, conf HandlerConfig, ) func(context.Context, events.APIGatewayProxyRequest) (any, error)
func APIGatewayProxyHandlerWithNewRelic ¶
func APIGatewayProxyHandlerWithNewRelic(h APIGatewayProxyHandlerFunc, conf HandlerConfig) lambda.Handler
func CloudWatchHandler ¶ added in v0.1.1
func CloudWatchHandler(h CloudWatchHandlerFunc, conf HandlerConfig) func(context.Context, events.CloudWatchEvent) (LambdaResult, error)
func CloudWatchHandlerWithNewRelic ¶ added in v0.1.1
func CloudWatchHandlerWithNewRelic(h CloudWatchHandlerFunc, conf HandlerConfig) lambda.Handler
func DynamoDbHandler ¶ added in v0.1.5
func DynamoDbHandler(h DynamoHandlerFunc, conf HandlerConfig) func(context.Context, events.DynamoDBEvent) error
func DynamoDbHandlerWithNewRelic ¶ added in v0.1.5
func DynamoDbHandlerWithNewRelic(h DynamoHandlerFunc, conf HandlerConfig) lambda.Handler
func LambdaAdapter ¶ added in v0.2.2
func LambdaAdapter(l LambdaHandler) func(http.ResponseWriter, *http.Request)
LambdaAdapter converts a LambdaHandler into a http.HandlerFunc.
func NewAuthorizerResponse ¶ added in v0.1.4
func NewAuthorizerResponse() events.APIGatewayCustomAuthorizerResponse
func NewHTTPHandler ¶ added in v0.2.2
func NewHTTPHandler(lambdaEndpoints LambdaHandlerEndpoints, portNumber int)
NewHTTPHandler creates a new HTTP server that listens on the given port.
func S3Handler ¶
func S3Handler(h S3HandlerFunc, conf HandlerConfig) func(context.Context, events.S3Event) error
func S3HandlerWithNewRelic ¶
func S3HandlerWithNewRelic(h S3HandlerFunc, conf HandlerConfig) lambda.Handler
func SQSHandler ¶
func SQSHandler(h SQSHandlerFunc, conf HandlerConfig) func(context.Context, events.SQSEvent) error
func SQSHandlerWithNewRelic ¶
func SQSHandlerWithNewRelic(h SQSHandlerFunc, conf HandlerConfig) lambda.Handler
func StepHandler ¶ added in v0.2.1
func StepHandler(h StepHandlerFunc, conf HandlerConfig) func(context.Context, StepEvent) (StepEvent, error)
func StepHandlerWithNewRelic ¶ added in v0.2.1
func StepHandlerWithNewRelic(h StepHandlerFunc, conf HandlerConfig) lambda.Handler
Types ¶
type APIGatewayCustomAuthorizerContext ¶ added in v0.1.4
type APIGatewayCustomAuthorizerContext struct { Context context.Context Request events.APIGatewayCustomAuthorizerRequestTypeRequest Response events.APIGatewayCustomAuthorizerResponse Logger zerolog.Logger NewRelicTx newrelic.Transaction CorrelationID string // contains filtered or unexported fields }
APIGatewayCustomAuthorizerContext the context for a request for Custom Authorizer
func (*APIGatewayCustomAuthorizerContext) AddNewRelicAttribute ¶ added in v0.1.4
func (c *APIGatewayCustomAuthorizerContext) AddNewRelicAttribute(key string, val interface{})
func (*APIGatewayCustomAuthorizerContext) AllowAllMethods ¶ added in v0.1.4
func (c *APIGatewayCustomAuthorizerContext) AllowAllMethods()
func (*APIGatewayCustomAuthorizerContext) AllowMethod ¶ added in v0.1.4
func (c *APIGatewayCustomAuthorizerContext) AllowMethod(verb, resource string)
func (*APIGatewayCustomAuthorizerContext) DenyAllMethods ¶ added in v0.1.4
func (c *APIGatewayCustomAuthorizerContext) DenyAllMethods()
func (*APIGatewayCustomAuthorizerContext) DenyMethod ¶ added in v0.1.4
func (c *APIGatewayCustomAuthorizerContext) DenyMethod(verb, resource string)
func (*APIGatewayCustomAuthorizerContext) SetPrincipalID ¶ added in v0.1.4
func (c *APIGatewayCustomAuthorizerContext) SetPrincipalID(principalID string)
type APIGatewayCustomAuthorizerHandlerFunc ¶ added in v0.1.4
type APIGatewayCustomAuthorizerHandlerFunc func(c *APIGatewayCustomAuthorizerContext) error
APIGatewayCustomAuthorizerHandlerFunc to populate
type APIGatewayProxyContext ¶
type APIGatewayProxyContext struct { Context context.Context Request events.APIGatewayProxyRequest Response events.APIGatewayProxyResponse Logger zerolog.Logger NewRelicTx newrelic.Transaction CorrelationID string }
func (*APIGatewayProxyContext) AddNewRelicAttribute ¶
func (c *APIGatewayProxyContext) AddNewRelicAttribute(key string, val interface{})
func (*APIGatewayProxyContext) Bind ¶
func (c *APIGatewayProxyContext) Bind(v interface{}) error
func (*APIGatewayProxyContext) GetCookie ¶ added in v0.1.3
func (c *APIGatewayProxyContext) GetCookie(name string) (http.Cookie, bool)
GetCookie retrieves the cookie with the given name
func (*APIGatewayProxyContext) GetHeader ¶ added in v0.1.3
func (c *APIGatewayProxyContext) GetHeader(name string) string
GetHeader retrieves the header value by name. It canonicalizes headers to ensure that values can be accessed in a case insensitive manner
func (*APIGatewayProxyContext) JSON ¶
func (c *APIGatewayProxyContext) JSON(statusCode int, body interface{}) error
type APIGatewayProxyHandlerFunc ¶
type APIGatewayProxyHandlerFunc func(c *APIGatewayProxyContext) error
type CloudWatchContext ¶ added in v0.1.1
type CloudWatchContext struct { Context context.Context Event events.CloudWatchEvent Logger zerolog.Logger NewRelicTx newrelic.Transaction CorrelationID string }
func (*CloudWatchContext) AddNewRelicAttribute ¶ added in v0.1.1
func (c *CloudWatchContext) AddNewRelicAttribute(key string, val interface{})
type CloudWatchHandlerFunc ¶ added in v0.1.1
type CloudWatchHandlerFunc func(c *CloudWatchContext) (LambdaResult, error)
type DynamoDbContext ¶ added in v0.1.5
type DynamoDbContext struct { Context context.Context EventRecord events.DynamoDBEventRecord Logger zerolog.Logger NewRelicTx newrelic.Transaction CorrelationID string }
func (*DynamoDbContext) AddNewRelicAttribute ¶ added in v0.1.5
func (c *DynamoDbContext) AddNewRelicAttribute(key string, val interface{})
type DynamoHandlerFunc ¶ added in v0.1.5
type DynamoHandlerFunc func(c *DynamoDbContext) error
type Err ¶
func ErrValidation ¶
type HandlerConfig ¶
type LambdaHandler ¶ added in v0.2.2
type LambdaHandlerEndpoints ¶ added in v0.2.2
type LambdaHandlerEndpoints []LambdaHandler
type LambdaResult ¶ added in v0.1.2
type LambdaResult interface{}
type S3Context ¶
type S3Context struct { Context context.Context EventRecord events.S3EventRecord Logger zerolog.Logger NewRelicTx newrelic.Transaction CorrelationID string }
func (*S3Context) AddNewRelicAttribute ¶
type S3HandlerFunc ¶
type SQSContext ¶
type SQSContext struct { Context context.Context Message events.SQSMessage Logger zerolog.Logger NewRelicTx newrelic.Transaction CorrelationID string }
func (*SQSContext) AddNewRelicAttribute ¶
func (c *SQSContext) AddNewRelicAttribute(key string, val interface{})
func (*SQSContext) Bind ¶
func (c *SQSContext) Bind(v interface{}) error
type SQSHandlerFunc ¶
type SQSHandlerFunc func(c *SQSContext) error
type SQSMessageEnvelope ¶
type SQSMessageEnvelope struct { Data interface{} `json:"data"` Meta *SQSMessageMeta `json:"meta"` }
type SQSMessageMeta ¶
type SQSMessageMeta struct {
CorrelationID string `json:"correlation_id"`
}
type StepContext ¶ added in v0.2.1
type StepContext struct { Context context.Context Event StepEvent Logger zerolog.Logger NewRelicTx newrelic.Transaction CorrelationID string }
func (*StepContext) AddNewRelicAttribute ¶ added in v0.2.1
func (c *StepContext) AddNewRelicAttribute(key string, val interface{})
type StepHandlerFunc ¶ added in v0.2.1
type StepHandlerFunc func(c *StepContext) (StepEvent, error)
type Validatable ¶
type Validatable interface {
Validate() error
}
Click to show internal directories.
Click to hide internal directories.