corlambda

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MaxLambdaRetries = 3

MaxLambdaRetries is the number of times to try invoking a function before giving up and returning an error

Variables

This section is empty.

Functions

This section is empty.

Types

type FunctionConfig

type FunctionConfig struct {
	FunctionDeployment
	Name                string
	RoleARN             string
	Timeout             int64
	MemorySize          int64
	CacheConfigInjector api.CacheConfigInjector

	S3Key    string
	S3Bucket string
	CodeHash string
	// contains filtered or unexported fields
}

FunctionConfig holds the configuration of an individual Lambda function

func (*FunctionConfig) NeedsUpdate

func (d *FunctionConfig) NeedsUpdate(cfg *lambda.FunctionConfiguration) bool

func (*FunctionConfig) Package

func (d *FunctionConfig) Package() error

func (*FunctionConfig) Prepare

func (d *FunctionConfig) Prepare() (*lambda.FunctionCode, error)

type FunctionDeployment

type FunctionDeployment interface {
	Package() error
	NeedsUpdate(cfg *lambda.FunctionConfiguration) bool
	Prepare() (*lambda.FunctionCode, error)
}

Wrapping Package generation and deployment-prepration into an interface for mocking and extension

type LambdaCacheConfigInjector

type LambdaCacheConfigInjector interface {
	api.CacheConfigInjector
	ConfigureLambda(*lambda.CreateFunctionInput) error
}

type LambdaClient

type LambdaClient struct {
	Client  lambdaiface.LambdaAPI
	Polling api.PollingStrategy
}

LambdaClient wraps the AWS Lambda API and provides functions for deploying and invoking lambda functions

func NewLambdaClient

func NewLambdaClient() *LambdaClient

NewLambdaClient initializes a new LambdaClient

func (*LambdaClient) DeleteFunction

func (l *LambdaClient) DeleteFunction(functionName string) error

DeleteFunction tears down the given function

func (*LambdaClient) DeployFunction

func (l *LambdaClient) DeployFunction(function *FunctionConfig) error

DeployFunction deploys the current directory as a lamba function

func (*LambdaClient) Invoke

func (l *LambdaClient) Invoke(functionName string, payload []byte) (outputPayload []byte, err error)

Invoke invokes the given Lambda function with the given payload.

Jump to

Keyboard shortcuts

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