lambda

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Function

type Function struct {
	// App to which this function belongs. This will be equivalent to the APP_NAME env var.
	App string
	// Name of the function. This will be equivalent to the FUNCTION_NAME env var.
	Name string
	// Deploy is a cloud identifier.
	Deploy string
	// Stage is an env identifier (e.g. "staging" or "production").
	Stage string
	// Logger is a field logger.
	Logger logrus.FieldLogger
	// Metrics provider defines interactions for recording metrics.
	MetricsProvider kitmetrics.Provider
	// contains filtered or unexported fields
}

Function defines configuration of a Lambda function.

func New

func New(config interface{}) *Function

New creates a new Function with a configured logger, rollbar agent and metrics provider.

func (*Function) Add

func (f *Function) Add(svs ...cmdutil.Server)

Add adds cmdutil.Servers to be run in the background.

func (*Function) FlushMetrics

func (f *Function) FlushMetrics() error

FlushMetrics is a hook for flushing metrics, to ensure they are sent before the invocation context is torn down.

func (*Function) Start

func (f *Function) Start(handler interface{})

Start takes a lambda handler that must satisfy one of the following signatures: * func () * func () error * func (TIn) error * func () (TOut, error) * func (TIn) (TOut, error) * func (context.Context) error * func (context.Context, TIn) error * func (context.Context) (TOut, error) * func (context.Context, TIn) (TOut, error) * * Where "TIn" and "TOut" are types compatible with the "encoding/json" standard library. * See https://golang.org/pkg/encoding/json/#Unmarshal for how deserialization behaves. * * See https://github.com/aws/aws-lambda-go/blob/main/lambda/entry.go for more info.

Jump to

Keyboard shortcuts

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