lambda

package module
v0.0.0-...-7c8eb32 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AOHTTPHeader = "x-trace"
)

Variables

This section is empty.

Functions

func HandlerWithWrapper

func HandlerWithWrapper(handlerFunc interface{}, w Wrapper) interface{}

HandlerWithWrapper wraps a function with the wrapper and returns the wrapped function.

func Wrap

func Wrap(handlerFunc interface{}) interface{}

Wrap wraps the AWS Lambda handler and do the instrumentation. It returns a new handler and can be passed into lambda.Start()

Types

type Wrapper

type Wrapper interface {
	// Before is called before the real handler is called.
	Before(context.Context, json.RawMessage, ...interface{}) context.Context
	// After is called after the real handler is called.
	After(interface{}, *typedError, ...interface{}) interface{}
}

Wrapper offers the ability to be called before and after a handler is executed.

Jump to

Keyboard shortcuts

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