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) FlushMetrics ¶
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.