invoker

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeLambdaClient

func InitializeLambdaClient(ctx context.Context, region string) (*lambda.Client, error)

func InvokeLambdaCmd

func InvokeLambdaCmd(ctx context.Context, config *LambdaInvokerConfig)

Types

type APIGatewayProxyRequest

type APIGatewayProxyRequest struct {
	Body    string            `json:"body"`
	Headers map[string]string `json:"headers"`
}

func CreateAPIGatewayProxyRequest

func CreateAPIGatewayProxyRequest(requestPayload *RequestPayload) (*APIGatewayProxyRequest, error)

type LambdaClient

type LambdaClient interface {
	Invoke(ctx context.Context, params *lambda.InvokeInput, optFns ...func(*lambda.Options)) (*lambda.InvokeOutput, error)
}

type LambdaInvokerConfig

type LambdaInvokerConfig struct {
	LambdaName string `json:"lambdaName"`
	Request    string `json:"request"`
	Region     string `json:"region"`
	WorkingDir string `json:"workingDir"`
}

type LambdaInvokerService

type LambdaInvokerService struct {
	LambdaClient LambdaClient
	LambdaName   string
}

func (*LambdaInvokerService) InvokeLambda

func (lambdaInvokerService *LambdaInvokerService) InvokeLambda(ctx context.Context, payload []byte) (*lambda.InvokeOutput, error)

type RequestPayload

type RequestPayload struct {
	Body    map[string]string `json:"body"`
	Headers map[string]string `json:"headers"`
}

func GetPayloadFromConfig

func GetPayloadFromConfig(config *LambdaInvokerConfig) (*RequestPayload, error)

Jump to

Keyboard shortcuts

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