MCPcopy Create free account
hub / github.com/dan-v/lambda-nat-proxy / getS3Client

Function getS3Client

lambda/main.go:34–44  ·  view source on GitHub ↗

getS3Client returns the S3 client, initializing it if necessary

()

Source from the content-addressed store, hash-verified

32
33// getS3Client returns the S3 client, initializing it if necessary
34func getS3Client() (*s3.S3, error) {
35 if s3Client == nil {
36 var err error
37 s3Client, err = shared.CreateS3Client(shared.DefaultAWSRegion)
38 if err != nil {
39 shared.LogError("Failed to create S3 client", err)
40 return nil, fmt.Errorf("failed to initialize S3 client: %w", err)
41 }
42 }
43 return s3Client, nil
44}
45
46func LambdaHandler(ctx context.Context, s3Event events.S3Event) error {
47 shared.LogTargetf("Lambda triggered with %d S3 events", len(s3Event.Records))

Callers 1

handleHolePunchRequestFunction · 0.85

Calls 2

CreateS3ClientFunction · 0.92
LogErrorFunction · 0.92

Tested by

no test coverage detected