lambda

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: BSD-3-Clause Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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