Skip to content

Commit 56a0f54

Browse files
authored
documentation rework (#608)
1 parent bbde148 commit 56a0f54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+723
-1411
lines changed

README.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
# AWS Lambda for Go
22

3-
[![tests][1]][2]
4-
[![Go Reference][5]][6]
5-
[![GoCard][7]][8]
6-
[![codecov][9]][10]
7-
8-
[1]: https://github.com/aws/aws-lambda-go/workflows/tests/badge.svg
9-
[2]: https://github.com/aws/aws-lambda-go/actions?query=workflow%3Atests
10-
[5]: https://pkg.go.dev/badge/github.com/aws/aws-lambda-go.svg
11-
[6]: https://pkg.go.dev/github.com/aws/aws-lambda-go
12-
[7]: https://goreportcard.com/badge/github.com/aws/aws-lambda-go
13-
[8]: https://goreportcard.com/report/github.com/aws/aws-lambda-go
14-
[9]: https://codecov.io/gh/aws/aws-lambda-go/branch/master/graph/badge.svg
15-
[10]: https://codecov.io/gh/aws/aws-lambda-go
3+
[![tests](https://github.com/aws/aws-lambda-go/workflows/tests/badge.svg)](https://github.com/aws/aws-lambda-go/actions?query=workflow%3Atests)
4+
[![Go Reference](https://pkg.go.dev/badge/github.com/aws/aws-lambda-go.svg)](https://pkg.go.dev/github.com/aws/aws-lambda-go)
5+
[![GoCard](https://goreportcard.com/badge/github.com/aws/aws-lambda-go)](https://goreportcard.com/report/github.com/aws/aws-lambda-go)
6+
[![codecov](https://codecov.io/gh/aws/aws-lambda-go/branch/master/graph/badge.svg)](https://codecov.io/gh/aws/aws-lambda-go)
167

178
Libraries, samples, and tools to help Go developers develop AWS Lambda functions.
189

@@ -108,5 +99,7 @@ To deploy your function, refer to the official documentation for [deploying usin
10899

109100
# Event Integrations
110101

111-
The [event models](https://github.com/aws/aws-lambda-go/tree/master/events) can be used to model AWS event sources. The official documentation has [detailed walkthroughs](https://docs.aws.amazon.com/lambda/latest/dg/use-cases.html).
102+
[![events package](https://pkg.go.dev/badge/github.com/aws/aws-lambda-go/events.svg)](https://pkg.go.dev/github.com/aws/aws-lambda-go/events)
103+
104+
The events package provides type definitions for common AWS event sources. The official documentation has [detailed walkthroughs](https://docs.aws.amazon.com/lambda/latest/dg/use-cases.html).
112105

cfn/README.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

cfn/doc.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Package cfn provides helpers for implementing AWS CloudFormation custom resources.
2+
//
3+
// CloudFormation custom resources allow you to write custom provisioning logic that CloudFormation
4+
// runs when you create, update, or delete stacks. This package handles the response protocol,
5+
// making it easier to implement custom resource handlers.
6+
//
7+
// The LambdaWrap helper catches errors and ensures proper responses are sent to CloudFormation's
8+
// pre-signed URL, preventing stack operations from hanging.
9+
//
10+
// See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html
11+
package cfn

cfn/example_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cfn_test
2+
3+
import (
4+
"context"
5+
6+
"github.com/aws/aws-lambda-go/cfn"
7+
"github.com/aws/aws-lambda-go/lambda"
8+
)
9+
10+
// CloudFormation custom resources require a different response handling due to the way stacks execute.
11+
// The cfn.LambdaWrap helper catches all errors and ensures the correct response is sent to the
12+
// pre-signed URL that comes with the event.
13+
//
14+
// This example safely 'Echo' back anything given into the Echo parameter within the Custom Resource call.
15+
func Example() {
16+
lambda.Start(cfn.LambdaWrap(func(ctx context.Context, event cfn.Event) (physicalResourceID string, data map[string]interface{}, err error) {
17+
v, _ := event.ResourceProperties["Echo"].(string)
18+
19+
data = map[string]interface{}{
20+
"Echo": v,
21+
}
22+
23+
return
24+
}))
25+
}

events/README.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

events/README_ALBTargetGroupEvents.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

events/README_ApiGatewayCustomAuthorizer.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

events/README_ApiGatewayEvent.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

events/README_AutoScaling.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)