Documentation ¶
Index ¶
- Constants
- func ContextWithTracer(t tracer.Tracer, ctx ...context.Context) context.Context
- func DebugLog(debugMode bool, args ...interface{})
- func Error(value interface{}, args ...context.Context)
- func ExtractRequestData(req *http.Request) (headers string, body string)
- func ExtractTracer(ctx []context.Context) tracer.Tracer
- func FormatHeaders(headers http.Header) (string, error)
- func GeneralEpsagonRecover(exceptionType, msg string, currentTracer tracer.Tracer)
- func Label(key string, value interface{}, args ...context.Context)
- func MatchUserError(exception interface{}) types.GomegaMatcher
- func NewReadCloser(body []byte, err error) io.ReadCloser
- func ShouldIgnoreRequest(contentType string, path string) bool
- func TypeError(value interface{}, errorType string, args ...context.Context)
- func WrapLambdaHandler(config *Config, handler interface{}) interface{}
- type APIGatewayEventFields
- type Config
- type GenericFunction
- type GenericWrapper
Constants ¶
const DefaultErrorType = "Error"
DefaultErrorType Default custom error type
const MaxMetadataSize = 10 * 1024
MaxMetadataSize Maximum size of event metadata
const TimeoutErrorCode protocol.ErrorCode = 3
Variables ¶
This section is empty.
Functions ¶
func ContextWithTracer ¶
ContextWithTracer creates a context with given tracer
func ExtractRequestData ¶
ExtractRequestData extracts headers and body from http.Request
func ExtractTracer ¶
ExtractTracer Extracts the tracer from given contexts (using first context), returns Global tracer if no context is given and GlobalTracer is valid (= non nil, not stopped)
func FormatHeaders ¶
FormatHeaders format HTTP headers to string - using first header value, ignoring the rest
func GeneralEpsagonRecover ¶
GeneralEpsagonRecover recover function that will send exception to epsagon exceptionType, msg are strings that will be added to the exception
func MatchUserError ¶
func MatchUserError(exception interface{}) types.GomegaMatcher
MatchUserError matches epsagon exceptions
func NewReadCloser ¶
func NewReadCloser(body []byte, err error) io.ReadCloser
NewReadCloser returns an io.ReadCloser will mimick read from body depending on given error
func ShouldIgnoreRequest ¶
ShouldIgnoreRequest checks whether HTTP request should be ignored according to given content type and request path
func WrapLambdaHandler ¶
func WrapLambdaHandler(config *Config, handler interface{}) interface{}
WrapLambdaHandler wraps a generic wrapper for lambda function with epsagon tracing
Types ¶
type APIGatewayEventFields ¶
type APIGatewayEventFields struct {
// contains filtered or unexported fields
}
type Config ¶
Config is the configuration for Epsagon's tracer
func NewTracerConfig ¶
NewTracerConfig creates a new tracer Config
type GenericFunction ¶
GenericFunction type
func ConcurrentGoWrapper ¶
func ConcurrentGoWrapper(config *Config, wrappedFunction interface{}, args ...string) GenericFunction
ConcurrentGoWrapper wraps the function with epsagon's tracer
func GoWrapper ¶
func GoWrapper(config *Config, wrappedFunction interface{}, args ...string) GenericFunction
GoWrapper wraps the function with epsagon's tracer
type GenericWrapper ¶
type GenericWrapper struct {
// contains filtered or unexported fields
}
GenericWrapper is a generic lambda function type
func WrapGenericFunction ¶
func WrapGenericFunction( handler interface{}, config *Config, tracer tracer.Tracer, injectContext bool, resourceName string) *GenericWrapper
WrapGenericFunction return an epsagon wrapper for a generic function
func (*GenericWrapper) Call ¶
func (wrapper *GenericWrapper) Call(args ...interface{}) (results []reflect.Value)
Call the wrapped function
func (*GenericWrapper) GetRunnerEvent ¶
func (wrapper *GenericWrapper) GetRunnerEvent() *protocol.Event
GetRunnerEvent returns the wrapper runner event