corlambda

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 16 Imported by: 1 module, 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

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
}

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