standard

package module
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default(h lambda.Handler, opts ...Option)

Default configures a standard lambda handler with default middleware which includes the zerolog and raw logging.

func GenericDefault

func GenericDefault[I any, O any](handler func(context.Context, I) (O, error), opts ...Option)

GenericDefault configures a generic standard lambda handler with default middleware which includes the zerolog and raw logging.

Types

type Option

type Option func(config *defaultConfig)

func Append

func Append(mw middleware.Middleware) Option

Append middleware to the chain. Defaults to raw and zerolog middleware.

func Fields

func Fields(fields map[string]interface{}) Option

Fields pass a map of attributes which are appended to all log messages and raw events.

func LogLevel

func LogLevel(level zerolog.Level) Option

LogLevel minimum accepted level for logging. Defaults to zerolog.InfoLevel.

func Output

func Output(output io.Writer) Option

Output is a writer where logs in JSON format are written. Defaults to os.Stderr.

func RawEnabled

func RawEnabled(flag bool) Option

RawEnabled is a flag to toggle this middleware on or off. Defaults to true.

Jump to

Keyboard shortcuts

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