Documentation ¶
Overview ¶
Package handlertrace allows middleware authors using lambda.NewHandler to instrument request and response events.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewContext(ctx context.Context, trace HandlerTrace) context.Context
NewContext adds callbacks to the provided context which allows handlers which wrap the return value of lambda.NewHandler to access to the request and response events.
Types ¶
type HandlerTrace ¶
type HandlerTrace struct { RequestEvent func(context.Context, interface{}) ResponseEvent func(context.Context, interface{}) }
HandlerTrace allows handlers which wrap the return value of lambda.NewHandler to access to the request and response events.
func FromContext ¶
func FromContext(ctx context.Context) HandlerTrace
FromContext returns the HandlerTrace associated with the provided context.
Click to show internal directories.
Click to hide internal directories.