Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit bcfd58d

Browse files
committed
Updating readme to address awslabs#11.
1 parent 3db9dec commit bcfd58d

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ $ go get github.com/aws/aws-lambda-go/events
1010
$ go get github.com/aws/aws-lambda-go/lambda
1111

1212
# Next, we install the core library
13-
$ go get github.com/awslabs/aws-lambda-go-api-proxy
13+
$ go get github.com/awslabs/aws-lambda-go-api-proxy/...
1414
```
1515

16-
Following the instructions from the [Lambda documentation](https://docs.aws.amazon.com/lambda/latest/dg/go-programming-model-handler-types.html), we need to declare a `Handler` method for our main package. We will declare a `ginlambda.GinLambda` object
16+
Following the instructions from the [Lambda documentation](https://docs.aws.amazon.com/lambda/latest/dg/go-programming-model-handler-types.html), we need to declare a `Handler` method for our main package. We will declare a `ginadapter.GinLambda` object
1717
in the global scope, initialized once it in the Handler with all its API methods, and then use the `Proxy` method to translate requests and responses
1818

1919
```go
@@ -56,6 +56,9 @@ func main() {
5656
}
5757
```
5858

59+
## Other frameworks
60+
This package also supports [Negroni](https://github.com/urfave/negroni), [GorillaMux](https://github.com/gorilla/mux), and plain old `HandlerFunc` - take a look at the code in their respective sub-directories. All packages implement the `Proxy` method exactly like our Gin sample above.
61+
5962
## Deploying the sample
6063
We have included a [SAM template](https://github.com/awslabs/serverless-application-model) with our sample application. You can use the [AWS CLI](https://aws.amazon.com/cli/) to quickly deploy the application in your AWS account.
6164

@@ -94,9 +97,9 @@ stageVarValue := apiGwStageVars["MyStageVar"]
9497
```
9598

9699
## Supporting other frameworks
97-
The `aws-lambda-go-api-proxy` library includes two package: `ginlambda` and `core`. The `ginlambda` package contains the [Gin](https://gin-gonic.github.io/gin/)-specific implementation of the library. The `core` package, contains utility methods and interfaces to translate API Gateway proxy events into Go's default `http.Request` and `http.ResponseWriter` objects.
100+
The `aws-lambda-go-api-proxy`, alongside the various adapters, declares a `core` package. The `core` package, contains utility methods and interfaces to translate API Gateway proxy events into Go's default `http.Request` and `http.ResponseWriter` objects.
98101

99-
You can see that the [`ginlambda.go`](gin/ginlambda.go) file extends the `RequestAccesor` struct defined in the [`request.go`](core/request.go) file. `RequestAccessor` gives you access to the `ProxyEventToHTTPRequest()` method.
102+
You can see that the [`ginlambda.go`](gin/adapter.go) file extends the `RequestAccesor` struct defined in the [`request.go`](core/request.go) file. `RequestAccessor` gives you access to the `ProxyEventToHTTPRequest()` method.
100103

101104
The `GinLambda` object is initialized with an instance of `gin.Engine`. `gin.Engine` implements methods defined in the `http.Handler` interface.
102105

vendor/vendor.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
"revision": "925541529c1fa6821df4e44ce2723319eb2be768",
6363
"revisionTime": "2018-01-25T21:43:03Z"
6464
},
65+
{
66+
"checksumSHA1": "uFNLkTxk8BkHTk0Jcub2lj2BX4M=",
67+
"path": "github.com/google/uuid",
68+
"revision": "dec09d789f3dba190787f8b4454c7d3c936fed9e",
69+
"revisionTime": "2017-11-29T19:10:14Z"
70+
},
6571
{
6672
"checksumSHA1": "g/V4qrXjUGG9B+e3hB+4NAYJ5Gs=",
6773
"path": "github.com/gorilla/context",
@@ -73,12 +79,6 @@
7379
"path": "github.com/gorilla/mux",
7480
"revision": "c0091a029979286890368b4c7b301261e448e242",
7581
"revisionTime": "2018-01-20T07:58:19Z"
76-
},
77-
{
78-
"checksumSHA1": "uFNLkTxk8BkHTk0Jcub2lj2BX4M=",
79-
"path": "github.com/google/uuid",
80-
"revision": "dec09d789f3dba190787f8b4454c7d3c936fed9e",
81-
"revisionTime": "2017-11-29T19:10:14Z"
8282
},
8383
{
8484
"checksumSHA1": "6L/3XPIhlmbIX4AMgW8UnguuyWo=",

0 commit comments

Comments
 (0)