MCPcopy Index your code
hub / github.com/aws/aws-lambda-go / handler

Function handler

lambda/testdata/sleep.go:16–25  ·  view source on GitHub ↗
(ctx context.Context, event Event)

Source from the content-addressed store, hash-verified

14}
15
16func handler(ctx context.Context, event Event) (string, error) {
17 lc, _ := lambdacontext.FromContext(ctx)
18 logger := slog.Default().With("handler", "sleep-test")
19
20 logger.Info("processing", "request_id", lc.AwsRequestID, "sleep_ms", event.SleepMilliseconds)
21 time.Sleep(time.Duration(event.SleepMilliseconds) * time.Millisecond)
22 logger.Info("completed", "request_id", lc.AwsRequestID)
23
24 return "ok", nil
25}
26
27func main() {
28 lambda.Start(handler)

Callers 3

callBytesHandlerFuncFunction · 0.50
TestWrapFunction · 0.50
TestRequestContextFunction · 0.50

Calls 1

FromContextFunction · 0.92

Tested by 2

TestWrapFunction · 0.40
TestRequestContextFunction · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…