lambda

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultOutputName          = "bootstrap"
	DefaultBinaryZipName       = "deployment.zip"
	DefaultLambdaInvokeType    = "RequestResponse"
	DefaultLambdaInvokeLogType = "Tail"
)

Variables

This section is empty.

Functions

func GetTraceID

func GetTraceID(ctx context.Context) string

GetTraceID gets the trace id from the context. The value is in the format of "Root=1-5abc5ca4-f07ab5d0a2c2b2f0730acb08;Parent=200406d9510e71a3;Sampled=0" and the root trace id is parsed out and returned.

func InvocationLogger

func InvocationLogger(ctx context.Context, l *zap.SugaredLogger, invType sls.InvokeTrigger) *zap.SugaredLogger

InvocationLogger gets a logger with fields initialized for a particular invocation.

Types

type AdapterAPI

type AdapterAPI interface {
	UpdateFunctionCode(ctx context.Context, params *awsLambda.UpdateFunctionCodeInput, optFns ...func(*awsLambda.Options)) (*awsLambda.UpdateFunctionCodeOutput, error)
	UpdateFunctionConfiguration(ctx context.Context, params *awsLambda.UpdateFunctionConfigurationInput, optFns ...func(*awsLambda.Options)) (*awsLambda.UpdateFunctionConfigurationOutput, error)
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(api AdapterAPI) *Client

func NewClientWithConfig

func NewClientWithConfig(cfg aws.Config) *Client

func (*Client) Compile

func (c *Client) Compile(data sls.BuildSettings) (sls.BuildResult, error)

func (*Client) UpdateCode

func (c *Client) UpdateCode(ctx context.Context, cp CodePayload) (*FeatureUpdateReport, error)

func (*Client) UpdateConfig

func (c *Client) UpdateConfig(ctx context.Context, fs FeatureSettings) (*FeatureUpdateReport, error)

type CodePayload

type CodePayload struct {
	DryRun        bool
	Publish       bool
	QualifiedName string
	ZipFile       []byte
}

type FeatureSettings

type FeatureSettings struct {
	QualifiedName string
	EnvVars       map[string]string
	Timeout       *int32
	Role          *string
}

type FeatureUpdateReport

type FeatureUpdateReport struct {
	CodeSHA256           string
	CodeSize             int64
	Description          string
	EnvError             error
	LambdaARN            string
	LambdaName           string
	LastModified         string
	LastUpdateStatus     string
	LastUpdateReason     string
	LastUpdateReasonCode string
	PackageType          string
	RevisionID           string
	Role                 string
	State                string
	StateReason          string
	StateReasonCode      string
	Timeout              int32
	Version              string
}

Jump to

Keyboard shortcuts

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