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

Commit 5e4a039

Browse files
authored
Update to use latest Iris and Echo, so Iris of these packages can still continue use this package (#71)
relative to: #70
1 parent 54c012a commit 5e4a039

File tree

10 files changed

+175
-583
lines changed

10 files changed

+175
-583
lines changed

core/request.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ func (r *RequestAccessor) EventToRequest(req events.APIGatewayProxyRequest) (*ht
200200
}
201201
}
202202

203-
httpRequest.RequestURI = httpRequest.URL.RequestURI()
203+
httpRequest.RequestURI = httpRequest.URL.RequestURI()
204204

205-
return httpRequest, nil
205+
return httpRequest, nil
206206
}
207207

208208
func addToHeader(req *http.Request, apiGwRequest events.APIGatewayProxyRequest) (*http.Request, error) {

core/request_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ func getProxyRequest(path string, method string) events.APIGatewayProxyRequest {
333333

334334
func getRequestContext() events.APIGatewayProxyRequestContext {
335335
return events.APIGatewayProxyRequestContext{
336-
AccountID: "x",
337-
RequestID: "x",
338-
APIID: "x",
339-
Stage: "prod",
336+
AccountID: "x",
337+
RequestID: "x",
338+
APIID: "x",
339+
Stage: "prod",
340340
DomainName: "12abcdefgh.execute-api.us-east-2.amazonaws.com",
341341
}
342342
}

core/response.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ const contentTypeHeaderKey = "Content-Type"
1818
// ProxyResponseWriter implements http.ResponseWriter and adds the method
1919
// necessary to return an events.APIGatewayProxyResponse object
2020
type ProxyResponseWriter struct {
21-
headers http.Header
22-
body bytes.Buffer
23-
status int
24-
observers []chan <-bool
21+
headers http.Header
22+
body bytes.Buffer
23+
status int
24+
observers []chan<- bool
2525
}
2626

2727
// NewProxyResponseWriter returns a new ProxyResponseWriter object.
2828
// The object is initialized with an empty map of headers and a
2929
// status code of -1
3030
func NewProxyResponseWriter() *ProxyResponseWriter {
3131
return &ProxyResponseWriter{
32-
headers: make(http.Header),
33-
status: defaultStatusCode,
32+
headers: make(http.Header),
33+
status: defaultStatusCode,
3434
observers: make([]chan<- bool, 0),
3535
}
3636

@@ -111,7 +111,7 @@ func (r *ProxyResponseWriter) GetProxyResponse() (events.APIGatewayProxyResponse
111111

112112
return events.APIGatewayProxyResponse{
113113
StatusCode: r.status,
114-
Headers: proxyHeaders,
114+
Headers: proxyHeaders,
115115
MultiValueHeaders: http.Header(r.headers),
116116
Body: output,
117117
IsBase64Encoded: isBase64,

echo/adapter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"github.com/aws/aws-lambda-go/events"
1111
"github.com/awslabs/aws-lambda-go-api-proxy/core"
12-
"github.com/labstack/echo"
12+
"github.com/labstack/echo/v4"
1313
)
1414

1515
// EchoLambda makes it easy to send API Gateway proxy events to a echo.Echo.

echo/echolambda_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"log"
55

66
"github.com/aws/aws-lambda-go/events"
7-
"github.com/awslabs/aws-lambda-go-api-proxy/echo"
8-
"github.com/labstack/echo"
7+
echoadapter "github.com/awslabs/aws-lambda-go-api-proxy/echo"
8+
"github.com/labstack/echo/v4"
99

1010
. "github.com/onsi/ginkgo"
1111
. "github.com/onsi/gomega"

go.mod

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,13 @@
11
module github.com/awslabs/aws-lambda-go-api-proxy
22

3-
go 1.12
3+
go 1.14
44

55
require (
6-
github.com/Bowery/prompt v0.0.0-20190419144237-972d0ceb96f5 // indirect
7-
github.com/BurntSushi/toml v0.3.1 // indirect
8-
github.com/Joker/jade v1.0.0 // indirect
9-
github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398 // indirect
10-
github.com/aws/aws-lambda-go v1.17.0
11-
github.com/aymerick/raymond v2.0.2+incompatible // indirect
12-
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185 // indirect
13-
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
14-
github.com/fatih/structs v1.1.0 // indirect
15-
github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4 // indirect
16-
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7
17-
github.com/gin-gonic/gin v0.0.0-20180126034611-783c7ee9c14e
18-
github.com/go-chi/chi v0.0.0-20180202194135-e223a795a06a
19-
github.com/golang/protobuf v1.0.0
20-
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf // indirect
21-
github.com/google/uuid v0.0.0-20171129191014-dec09d789f3d
22-
github.com/gorilla/context v1.1.1
23-
github.com/gorilla/mux v0.0.0-20180120075819-c0091a029979
24-
github.com/gorilla/schema v1.1.0 // indirect
25-
github.com/iris-contrib/blackfriday v2.0.0+incompatible // indirect
26-
github.com/iris-contrib/formBinder v5.0.0+incompatible // indirect
27-
github.com/iris-contrib/go.uuid v2.0.0+incompatible // indirect
28-
github.com/json-iterator/go v0.0.0-20180128142709-bca911dae073
29-
github.com/kardianos/govendor v1.0.9 // indirect
30-
github.com/kataras/golog v0.0.0-20190624001437-99c81de45f40 // indirect
31-
github.com/kataras/iris v11.1.1+incompatible
32-
github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d // indirect
33-
github.com/klauspost/compress v1.7.4 // indirect
34-
github.com/klauspost/cpuid v1.2.1 // indirect
35-
github.com/labstack/echo v3.3.10+incompatible
36-
github.com/labstack/gommon v0.2.8 // indirect
37-
github.com/mattn/go-colorable v0.1.1 // indirect
38-
github.com/mattn/go-isatty v0.0.5
39-
github.com/microcosm-cc/bluemonday v1.0.2 // indirect
40-
github.com/onsi/ginkgo v0.0.0-20180119174237-747514b53ddd
41-
github.com/onsi/gomega v1.3.0
42-
github.com/pkg/errors v0.8.1 // indirect
43-
github.com/ryanuber/columnize v2.1.0+incompatible // indirect
44-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
45-
github.com/ugorji/go v0.0.0-20180129160544-d2b24cf3d3b4
46-
github.com/urfave/negroni v0.0.0-20180130044549-22c5532ea862
47-
github.com/valyala/fasttemplate v1.0.1 // indirect
48-
golang.org/x/net v0.0.0-20190311183353-d8887717615a
49-
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223
50-
golang.org/x/text v0.3.0
51-
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c // indirect
52-
gopkg.in/go-playground/validator.v8 v8.18.2
53-
gopkg.in/yaml.v2 v2.2.2
6+
github.com/aws/aws-lambda-go v1.18.0
7+
github.com/gin-gonic/gin v1.6.3
8+
github.com/go-chi/chi v4.1.2+incompatible
9+
github.com/gorilla/mux v1.7.4
10+
github.com/kataras/iris/v12 v12.1.8
11+
github.com/labstack/echo/v4 v4.1.16
12+
github.com/urfave/negroni v1.0.0
5413
)

0 commit comments

Comments
 (0)