Skip to content

Commit

Permalink
Update to use latest Iris and Echo, so Iris of these packages can sti…
Browse files Browse the repository at this point in the history
…ll continue use this package

relative to: awslabs#70
  • Loading branch information
kataras committed Jul 27, 2020
1 parent 54c012a commit b6b264a
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 583 deletions.
4 changes: 2 additions & 2 deletions core/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ func (r *RequestAccessor) EventToRequest(req events.APIGatewayProxyRequest) (*ht
}
}

httpRequest.RequestURI = httpRequest.URL.RequestURI()
httpRequest.RequestURI = httpRequest.URL.RequestURI()

return httpRequest, nil
return httpRequest, nil
}

func addToHeader(req *http.Request, apiGwRequest events.APIGatewayProxyRequest) (*http.Request, error) {
Expand Down
8 changes: 4 additions & 4 deletions core/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,10 @@ func getProxyRequest(path string, method string) events.APIGatewayProxyRequest {

func getRequestContext() events.APIGatewayProxyRequestContext {
return events.APIGatewayProxyRequestContext{
AccountID: "x",
RequestID: "x",
APIID: "x",
Stage: "prod",
AccountID: "x",
RequestID: "x",
APIID: "x",
Stage: "prod",
DomainName: "12abcdefgh.execute-api.us-east-2.amazonaws.com",
}
}
Expand Down
14 changes: 7 additions & 7 deletions core/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ const contentTypeHeaderKey = "Content-Type"
// ProxyResponseWriter implements http.ResponseWriter and adds the method
// necessary to return an events.APIGatewayProxyResponse object
type ProxyResponseWriter struct {
headers http.Header
body bytes.Buffer
status int
observers []chan <-bool
headers http.Header
body bytes.Buffer
status int
observers []chan<- bool
}

// NewProxyResponseWriter returns a new ProxyResponseWriter object.
// The object is initialized with an empty map of headers and a
// status code of -1
func NewProxyResponseWriter() *ProxyResponseWriter {
return &ProxyResponseWriter{
headers: make(http.Header),
status: defaultStatusCode,
headers: make(http.Header),
status: defaultStatusCode,
observers: make([]chan<- bool, 0),
}

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

return events.APIGatewayProxyResponse{
StatusCode: r.status,
Headers: proxyHeaders,
Headers: proxyHeaders,
MultiValueHeaders: http.Header(r.headers),
Body: output,
IsBase64Encoded: isBase64,
Expand Down
2 changes: 1 addition & 1 deletion echo/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/aws/aws-lambda-go/events"
"github.com/awslabs/aws-lambda-go-api-proxy/core"
"github.com/labstack/echo"
"github.com/labstack/echo/v4"
)

// EchoLambda makes it easy to send API Gateway proxy events to a echo.Echo.
Expand Down
4 changes: 2 additions & 2 deletions echo/echolambda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"log"

"github.com/aws/aws-lambda-go/events"
"github.com/awslabs/aws-lambda-go-api-proxy/echo"
"github.com/labstack/echo"
echoadapter "github.com/awslabs/aws-lambda-go-api-proxy/echo"
"github.com/labstack/echo/v4"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down
57 changes: 8 additions & 49 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,54 +1,13 @@
module github.com/awslabs/aws-lambda-go-api-proxy

go 1.12
go 1.14

require (
github.com/Bowery/prompt v0.0.0-20190419144237-972d0ceb96f5 // indirect
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/Joker/jade v1.0.0 // indirect
github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398 // indirect
github.com/aws/aws-lambda-go v1.17.0
github.com/aymerick/raymond v2.0.2+incompatible // indirect
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185 // indirect
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4 // indirect
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7
github.com/gin-gonic/gin v0.0.0-20180126034611-783c7ee9c14e
github.com/go-chi/chi v0.0.0-20180202194135-e223a795a06a
github.com/golang/protobuf v1.0.0
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf // indirect
github.com/google/uuid v0.0.0-20171129191014-dec09d789f3d
github.com/gorilla/context v1.1.1
github.com/gorilla/mux v0.0.0-20180120075819-c0091a029979
github.com/gorilla/schema v1.1.0 // indirect
github.com/iris-contrib/blackfriday v2.0.0+incompatible // indirect
github.com/iris-contrib/formBinder v5.0.0+incompatible // indirect
github.com/iris-contrib/go.uuid v2.0.0+incompatible // indirect
github.com/json-iterator/go v0.0.0-20180128142709-bca911dae073
github.com/kardianos/govendor v1.0.9 // indirect
github.com/kataras/golog v0.0.0-20190624001437-99c81de45f40 // indirect
github.com/kataras/iris v11.1.1+incompatible
github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d // indirect
github.com/klauspost/compress v1.7.4 // indirect
github.com/klauspost/cpuid v1.2.1 // indirect
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.2.8 // indirect
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mattn/go-isatty v0.0.5
github.com/microcosm-cc/bluemonday v1.0.2 // indirect
github.com/onsi/ginkgo v0.0.0-20180119174237-747514b53ddd
github.com/onsi/gomega v1.3.0
github.com/pkg/errors v0.8.1 // indirect
github.com/ryanuber/columnize v2.1.0+incompatible // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/ugorji/go v0.0.0-20180129160544-d2b24cf3d3b4
github.com/urfave/negroni v0.0.0-20180130044549-22c5532ea862
github.com/valyala/fasttemplate v1.0.1 // indirect
golang.org/x/net v0.0.0-20190311183353-d8887717615a
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223
golang.org/x/text v0.3.0
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c // indirect
gopkg.in/go-playground/validator.v8 v8.18.2
gopkg.in/yaml.v2 v2.2.2
github.com/aws/aws-lambda-go v1.18.0
github.com/gin-gonic/gin v1.6.3
github.com/go-chi/chi v4.1.2+incompatible
github.com/gorilla/mux v1.7.4
github.com/kataras/iris/v12 v12.1.8
github.com/labstack/echo/v4 v4.1.16
github.com/urfave/negroni v1.0.0
)
Loading

0 comments on commit b6b264a

Please sign in to comment.