diff --git a/.travis.yml b/.travis.yml index 2dc92eafc..f86cb3d03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: go sudo: false go: - - 1.12.x - 1.14.x env: diff --git a/Makefile b/Makefile index 14bdcc9f1..698c37701 100644 --- a/Makefile +++ b/Makefile @@ -18,5 +18,5 @@ tidy: mv _examples examples && ( \ cd examples ; \ go mod tidy -v ; \ - go get -v -u=patch github.com/gavv/httpexpect ; \ + go get -v -u=patch github.com/iris-contrib/httpexpect ; \ ) && mv examples _examples diff --git a/README.md b/README.md index 933ffbef6..bc275d83e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# httpexpect [![GoDoc](https://godoc.org/github.com/gavv/httpexpect?status.svg)](https://godoc.org/github.com/gavv/httpexpect) [![Travis](https://img.shields.io/travis/gavv/httpexpect.svg)](https://travis-ci.org/gavv/httpexpect) [![Coveralls](https://coveralls.io/repos/github/gavv/httpexpect/badge.svg?branch=master)](https://coveralls.io/github/gavv/httpexpect?branch=master) +# httpexpect [![GoDoc](https://godoc.org/github.com/iris-contrib/httpexpect?status.svg)](https://godoc.org/github.com/iris-contrib/httpexpect) [![Travis](https://img.shields.io/travis/iris-contrib/httpexpect.svg)](https://travis-ci.org/iris-contrib/httpexpect) [![Coveralls](https://coveralls.io/repos/github/iris-contrib/httpexpect/badge.svg?branch=master)](https://coveralls.io/github/iris-contrib/httpexpect?branch=master) Concise, declarative, and easy to use end-to-end HTTP and REST API testing for Go (golang). @@ -48,7 +48,7 @@ Workflow: ##### Tuning -* Tests can communicate with server via real HTTP client or invoke `net/http` or [`fasthttp`](https://github.com/valyala/fasthttp/) handler directly. +* Tests can communicate with server via real HTTP client or invoke `net/http` handler directly. * Custom HTTP client, logger, printer, and failure reporter may be provided by user. * Custom HTTP request factory may be provided, e.g. from the Google App Engine testing. @@ -61,51 +61,21 @@ The current stable branch is `v2`. Previous branches are still maintained, but n If you're using go.mod, use a versioned import path: ```go -import "github.com/gavv/httpexpect/v2" -``` - -Otherwise, use gopkg.in import path: - -```go -import "gopkg.in/gavv/httpexpect.v2" +import "github.com/iris-contrib/httpexpect/v2" ``` ## Documentation -Documentation is available on [GoDoc](https://godoc.org/github.com/gavv/httpexpect). It contains an overview and reference. +Documentation is available on [GoDoc](https://godoc.org/github.com/iris-contrib/httpexpect). It contains an overview and reference. ## Examples See [`_examples`](_examples) directory for complete standalone examples. -* [`fruits_test.go`](_examples/fruits_test.go) - - Testing a simple CRUD server made with bare `net/http`. - * [`iris_test.go`](_examples/iris_test.go) Testing a server made with [`iris`](https://github.com/kataras/iris/) framework. Example includes JSON queries and validation, URL and form parameters, basic auth, sessions, and streaming. Tests invoke the `http.Handler` directly. -* [`echo_test.go`](_examples/echo_test.go) - - Testing a server with JWT authentication made with [`echo`](https://github.com/labstack/echo/) framework. Tests use either HTTP client or invoke the `http.Handler` directly. - -* [`gin_test.go`](_examples/gin_test.go) - - Testing a server utilizing the [`gin`](https://github.com/gin-gonic/gin) web framework. Tests invoke the `http.Handler` directly. - -* [`fasthttp_test.go`](_examples/fasthttp_test.go) - - Testing a server made with [`fasthttp`](https://github.com/valyala/fasthttp) package. Tests invoke the `fasthttp.RequestHandler` directly. - -* [`websocket_test.go`](_examples/websocket_test.go) - - Testing a WebSocket server based on [`gorilla/websocket`](https://github.com/gorilla/websocket). Tests invoke the `http.Handler` or `fasthttp.RequestHandler` directly. - -* [`gae_test.go`](_examples/gae_test.go) - - Testing a server running under the [Google App Engine](https://en.wikipedia.org/wiki/Google_App_Engine). - ## Quick start ##### Hello, world! @@ -118,7 +88,7 @@ import ( "net/http/httptest" "testing" - "github.com/gavv/httpexpect/v2" + "github.com/iris-contrib/httpexpect/v2" ) func TestFruits(t *testing.T) { @@ -440,17 +410,6 @@ e := httpexpect.WithConfig(httpexpect.Config{ Jar: httpexpect.NewJar(), }, }) - -// invoke fasthttp.RequestHandler directly using httpexpect.FastBinder -var handler fasthttp.RequestHandler = myHandler() - -e := httpexpect.WithConfig(httpexpect.Config{ - Reporter: httpexpect.NewAssertReporter(t), - Client: &http.Client{ - Transport: httpexpect.NewFastBinder(handler), - Jar: httpexpect.NewJar(), - }, -}) ``` ##### Per-request client or handler diff --git a/_examples/doc.go b/_examples/doc.go deleted file mode 100644 index 0ce3624bf..000000000 --- a/_examples/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package examples demonstrates httpexpect usage. -package examples diff --git a/_examples/echo.go b/_examples/echo.go deleted file mode 100644 index cfce9904e..000000000 --- a/_examples/echo.go +++ /dev/null @@ -1,49 +0,0 @@ -package examples - -import ( - "net/http" - - "github.com/dgrijalva/jwt-go" - "github.com/labstack/echo" - "github.com/labstack/echo/middleware" -) - -// EchoHandler creates http.Handler using echo framework. -// -// Routes: -// GET /login authenticate user and return JWT token -// GET /restricted/hello return "hello, world!" (requires authentication) -func EchoHandler() http.Handler { - e := echo.New() - - e.POST("/login", func(ctx echo.Context) error { - username := ctx.FormValue("username") - password := ctx.FormValue("password") - - if username == "ford" && password == "betelgeuse7" { - // create token - token := jwt.New(jwt.SigningMethodHS256) - - // generate encoded token and send it as response - t, err := token.SignedString([]byte("secret")) - if err != nil { - return err - } - return ctx.JSON(http.StatusOK, map[string]string{ - "token": t, - }) - } - - return echo.ErrUnauthorized - }) - - r := e.Group("/restricted") - - r.Use(middleware.JWT([]byte("secret"))) - - r.GET("/hello", func(ctx echo.Context) error { - return ctx.String(http.StatusOK, "hello, world!") - }) - - return e -} diff --git a/_examples/echo_test.go b/_examples/echo_test.go deleted file mode 100644 index 70967f2cb..000000000 --- a/_examples/echo_test.go +++ /dev/null @@ -1,87 +0,0 @@ -package examples - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/gavv/httpexpect/v2" -) - -// Echo JWT token authentication tests. -// -// This test is executed for the EchoHandler() in two modes: -// - via http client -// - via http.Handler -func testEcho(e *httpexpect.Expect) { - type Login struct { - Username string `form:"username"` - Password string `form:"password"` - } - - e.POST("/login").WithForm(Login{"ford", ""}). - Expect(). - Status(http.StatusUnauthorized) - - r := e.POST("/login").WithForm(Login{"ford", "betelgeuse7"}). - Expect(). - Status(http.StatusOK).JSON().Object() - - r.Keys().ContainsOnly("token") - - token := r.Value("token").String().Raw() - - e.GET("/restricted/hello"). - Expect(). - Status(http.StatusBadRequest) - - e.GET("/restricted/hello").WithHeader("Authorization", "Bearer "). - Expect(). - Status(http.StatusUnauthorized) - - e.GET("/restricted/hello").WithHeader("Authorization", "Bearer "+token). - Expect(). - Status(http.StatusOK).Body().Equal("hello, world!") - - auth := e.Builder(func(req *httpexpect.Request) { - req.WithHeader("Authorization", "Bearer "+token) - }) - - auth.GET("/restricted/hello"). - Expect(). - Status(http.StatusOK).Body().Equal("hello, world!") -} - -func TestEchoClient(t *testing.T) { - handler := EchoHandler() - - server := httptest.NewServer(handler) - defer server.Close() - - e := httpexpect.WithConfig(httpexpect.Config{ - BaseURL: server.URL, - Reporter: httpexpect.NewAssertReporter(t), - Printers: []httpexpect.Printer{ - httpexpect.NewDebugPrinter(t, true), - }, - }) - - testEcho(e) -} - -func TestEchoHandler(t *testing.T) { - handler := EchoHandler() - - e := httpexpect.WithConfig(httpexpect.Config{ - Client: &http.Client{ - Transport: httpexpect.NewBinder(handler), - Jar: httpexpect.NewJar(), - }, - Reporter: httpexpect.NewAssertReporter(t), - Printers: []httpexpect.Printer{ - httpexpect.NewDebugPrinter(t, true), - }, - }) - - testEcho(e) -} diff --git a/_examples/fasthttp.go b/_examples/fasthttp.go deleted file mode 100644 index 9b3d4494e..000000000 --- a/_examples/fasthttp.go +++ /dev/null @@ -1,23 +0,0 @@ -package examples - -import ( - "github.com/valyala/fasthttp" -) - -// FastHTTPHandler creates fasthttp.RequestHandler. -// -// Routes: -// GET /ping return "pong" -func FastHTTPHandler() fasthttp.RequestHandler { - return func(ctx *fasthttp.RequestCtx) { - switch string(ctx.Path()) { - case "/ping": - ctx.SetStatusCode(fasthttp.StatusOK) - ctx.SetContentType("text/plain") - ctx.SetBody([]byte("pong")) - - default: - panic("unsupported path") - } - } -} diff --git a/_examples/fasthttp_test.go b/_examples/fasthttp_test.go deleted file mode 100644 index 67ad8172b..000000000 --- a/_examples/fasthttp_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package examples - -import ( - "net/http" - "testing" - - "github.com/gavv/httpexpect/v2" -) - -// fastHTTPTester returns a new Expect instance to test FastHTTPHandler(). -func fastHTTPTester(t *testing.T) *httpexpect.Expect { - return httpexpect.WithConfig(httpexpect.Config{ - // Pass requests directly to FastHTTPHandler. - Client: &http.Client{ - Transport: httpexpect.NewFastBinder(FastHTTPHandler()), - Jar: httpexpect.NewJar(), - }, - // Report errors using testify. - Reporter: httpexpect.NewAssertReporter(t), - }) -} - -func TestFastHTTP(t *testing.T) { - e := fastHTTPTester(t) - - e.GET("/ping").Expect(). - Status(200). - Text().Equal("pong") -} diff --git a/_examples/fruits.go b/_examples/fruits.go deleted file mode 100644 index 64fe2ef7e..000000000 --- a/_examples/fruits.go +++ /dev/null @@ -1,85 +0,0 @@ -package examples - -import ( - "encoding/json" - "net/http" - "path" -) - -type ( - fruitMap map[string]interface{} -) - -// FruitsHandler creates http.Handler for the fruits server. -// -// Routes: -// GET /fruits get fruit list -// GET /fruits/{name} get fruit -// PUT /fruits/{name} add or update fruit -func FruitsHandler() http.Handler { - fruits := fruitMap{} - - mux := http.NewServeMux() - - mux.HandleFunc("/fruits", func(w http.ResponseWriter, r *http.Request) { - handleFruitList(fruits, w, r) - }) - - mux.HandleFunc("/fruits/", func(w http.ResponseWriter, r *http.Request) { - handleFruit(fruits, w, r) - }) - - return mux -} - -func handleFruitList(fruits fruitMap, w http.ResponseWriter, r *http.Request) { - switch r.Method { - case "GET": - ret := []string{} - for k := range fruits { - ret = append(ret, k) - } - - b, err := json.Marshal(ret) - if err != nil { - panic(err) - } - - w.Header().Set("Content-Type", "application/json") - w.Write(b) - - default: - w.WriteHeader(http.StatusMethodNotAllowed) - } -} - -func handleFruit(fruits fruitMap, w http.ResponseWriter, r *http.Request) { - _, name := path.Split(r.URL.Path) - - switch r.Method { - case "GET": - if data, ok := fruits[name]; ok { - b, err := json.Marshal(data) - if err != nil { - panic(err) - } - - w.Header().Set("Content-Type", "application/json") - w.Write(b) - } else { - w.WriteHeader(http.StatusNotFound) - } - - case "PUT": - var data map[string]interface{} - if err := json.NewDecoder(r.Body).Decode(&data); err != nil { - panic(err) - } - - fruits[name] = data - w.WriteHeader(http.StatusNoContent) - - default: - w.WriteHeader(http.StatusMethodNotAllowed) - } -} diff --git a/_examples/fruits_test.go b/_examples/fruits_test.go deleted file mode 100644 index 3257c80f9..000000000 --- a/_examples/fruits_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package examples - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/gavv/httpexpect/v2" -) - -func TestFruits(t *testing.T) { - handler := FruitsHandler() - - server := httptest.NewServer(handler) - defer server.Close() - - e := httpexpect.New(t, server.URL) - - e.GET("/fruits"). - Expect(). - Status(http.StatusOK).JSON().Array().Empty() - - orange := map[string]interface{}{ - "weight": 100, - } - - e.PUT("/fruits/orange").WithJSON(orange). - Expect(). - Status(http.StatusNoContent).NoContent() - - apple := map[string]interface{}{ - "colors": []interface{}{"green", "red"}, - "weight": 200, - } - - e.PUT("/fruits/apple").WithJSON(apple). - Expect(). - Status(http.StatusNoContent).NoContent() - - e.GET("/fruits"). - Expect(). - Status(http.StatusOK).JSON().Array().ContainsOnly("orange", "apple") - - e.GET("/fruits/orange"). - Expect(). - Status(http.StatusOK).JSON().Object().Equal(orange).NotEqual(apple) - - e.GET("/fruits/orange"). - Expect(). - Status(http.StatusOK). - JSON().Object().ContainsKey("weight").ValueEqual("weight", 100) - - obj := e.GET("/fruits/apple"). - Expect(). - Status(http.StatusOK).JSON().Object() - - obj.Keys().ContainsOnly("colors", "weight") - - obj.Value("colors").Array().Elements("green", "red") - obj.Value("colors").Array().Element(0).String().Equal("green") - obj.Value("colors").Array().Element(1).String().Equal("red") - - obj.Value("weight").Number().Equal(200) - - e.GET("/fruits/melon"). - Expect(). - Status(http.StatusNotFound) -} diff --git a/_examples/gae.go b/_examples/gae.go deleted file mode 100644 index b7335cd7d..000000000 --- a/_examples/gae.go +++ /dev/null @@ -1,22 +0,0 @@ -package examples - -import ( - "net/http" - - "google.golang.org/appengine" -) - -// GaeHandler creates http.Handler to run in the Google App Engine. -// -// Routes: -// GET /ping return "pong" -func GaeHandler() http.Handler { - m := http.NewServeMux() - - m.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) { - _ = appengine.NewContext(r) - w.Write([]byte("pong")) - }) - - return m -} diff --git a/_examples/gae_test.go b/_examples/gae_test.go deleted file mode 100644 index 4a058f015..000000000 --- a/_examples/gae_test.go +++ /dev/null @@ -1,63 +0,0 @@ -// +build never - -package examples - -import ( - "net/http" - "os" - "testing" - - "github.com/gavv/httpexpect/v2" - "google.golang.org/appengine/aetest" -) - -// These tests require installed Google Appengine SDK. -// https://cloud.google.com/appengine/downloads - -// init() is used by GAE to start serving the app -// added here for illustration purposes -func init() { - http.Handle("/", GaeHandler()) -} - -// gaeInstance is our global dev_appserver instance. -var gaeInstance aetest.Instance - -// TestMain is called first to create the gaeInstance. -func TestMain(m *testing.M) { - var err error - gaeInstance, err = aetest.NewInstance(nil) - if err != nil { - panic(err) - } - - c := m.Run() // call all actual tests - gaeInstance.Close() - os.Exit(c) -} - -// gaeTester returns a new Expect instance to test GaeHandler(). -func gaeTester(t *testing.T) *httpexpect.Expect { - return httpexpect.WithConfig(httpexpect.Config{ - // Use gaeInstance to create requests. - // aetest.Instance is compatible with httpexpect.RequestFactory. - RequestFactory: gaeInstance, - - // Pass requests directly to GaeHandler. - Client: &http.Client{ - Transport: httpexpect.NewBinder(GaeHandler()), - Jar: httpexpect.NewJar(), - }, - - // Report errors using testify. - Reporter: httpexpect.NewAssertReporter(t), - }) -} - -func TestGae(t *testing.T) { - e := gaeTester(t) - - e.GET("/ping").Expect(). - Status(200). - Text().Equal("pong") -} diff --git a/_examples/gin.go b/_examples/gin.go deleted file mode 100644 index 27c264b65..000000000 --- a/_examples/gin.go +++ /dev/null @@ -1,22 +0,0 @@ -package examples - -import ( - "github.com/gin-gonic/gin" -) - -// Rid of debug output -func init() { - gin.SetMode(gin.TestMode) -} - -// GinHandler Create add /example route to gin engine -func GinHandler(r *gin.Engine) *gin.Engine { - // Add route to the gin engine - r.GET("/example", func(c *gin.Context) { - c.JSON(200, gin.H{ - "message": "pong", - }) - }) - // return gin engine with newly added route - return r -} diff --git a/_examples/gin_test.go b/_examples/gin_test.go deleted file mode 100644 index afb59d168..000000000 --- a/_examples/gin_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package examples - -import ( - "net/http" - "testing" - - "github.com/gavv/httpexpect/v2" - "github.com/gin-gonic/gin" -) - -func TestGinHandler(t *testing.T) { - // Create new gin instance - engine := gin.New() - // Add /example route via handler function to the gin instance - handler := GinHandler(engine) - // Create httpexpect instance - e := httpexpect.WithConfig(httpexpect.Config{ - Client: &http.Client{ - Transport: httpexpect.NewBinder(handler), - Jar: httpexpect.NewJar(), - }, - Reporter: httpexpect.NewAssertReporter(t), - Printers: []httpexpect.Printer{ - httpexpect.NewDebugPrinter(t, true), - }, - }) - - // Assert response - e.GET("/example"). - Expect(). - Status(http.StatusOK).JSON().Object().ValueEqual("message", "pong") -} diff --git a/_examples/go.mod b/_examples/go.mod deleted file mode 100644 index cf120a2b0..000000000 --- a/_examples/go.mod +++ /dev/null @@ -1,21 +0,0 @@ -module examples - -go 1.12 - -require ( - github.com/dgrijalva/jwt-go v3.0.0+incompatible - github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 - github.com/gavv/httpexpect/v2 v2.0.3 - github.com/gin-gonic/gin v1.5.0 - github.com/gorilla/websocket v1.4.2 - github.com/kataras/iris/v12 v12.1.8 - github.com/klauspost/compress v1.9.8 // indirect - github.com/labstack/echo v3.1.0+incompatible - github.com/labstack/gommon v0.2.9 // indirect - github.com/moul/http2curl v1.0.0 // indirect - github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect - github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect - github.com/valyala/fasthttp v1.0.0 - google.golang.org/appengine v1.0.0 - gopkg.in/yaml.v2 v2.2.8 // indirect -) diff --git a/_examples/go.sum b/_examples/go.sum deleted file mode 100644 index fcd748cfd..000000000 --- a/_examples/go.sum +++ /dev/null @@ -1,274 +0,0 @@ -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 h1:sR+/8Yb4slttB4vD+b9btVEnWgL3Q00OBTzVT8B9C0c= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet/v3 v3.0.0 h1:1PwO5w5VCtlUUl+KTOBsTGZlhjWkcybsGaAau52tOy8= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= -github.com/Joker/hpp v1.0.0 h1:65+iuJYdRXv/XyN62C1uEmmOx3432rNG/rKlX6V7Kkc= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398 h1:WDC6ySpJzbxGWFh4aMxFFC28wwGp5pEuoTtvA4q/qQ4= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible h1:Ppm0npCCsmuR9oQaBtRuZcmILVE74aXE+AmrJj8L2ns= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgrijalva/jwt-go v3.0.0+incompatible h1:nfVqwkkhaRUethVJaQf5TUFdFr3YUF4lJBTf/F2XwVI= -github.com/dgrijalva/jwt-go v3.0.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= -github.com/gavv/httpexpect/v2 v2.0.3 h1:6ugOhnRxJ7Ep3ehaHA0ybQKp7/aH5SofRxiPD5aOMrE= -github.com/gavv/httpexpect/v2 v2.0.3/go.mod h1:LAoDcy8I/EXEtKJV6wMEJvOMAZVo0MfEk5u4NfiNQa4= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.5.0 h1:fi+bqFAx/oLK54somfCtEZs9HeH1LHVoEPUgARpTqyc= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127 h1:0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotfhkmOqEc= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.0.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imkira/go-interpol v1.0.0 h1:HrmLyvOLJyjR0YofMw8QGdCIuYOs4TJUBDNU5sJC09E= -github.com/imkira/go-interpol v1.0.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/iris-contrib/blackfriday v2.0.0+incompatible h1:o5sHQHHm0ToHUlAJSTjW9UWicjJSDDauOOQ2AHuIVp4= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible h1:XZubAYg61/JwnJNbZilGjf3b3pB80+OQg2qf6c8BfWE= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/jade v1.1.3 h1:p7J/50I0cjo0wq/VWVCDFd8taPJbuFC+bq23SniRFX0= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1 h1:zGP7pW51oi5eQZMIlGA3I+FHY9/HOQWDB+572yin0to= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1 h1:10g/WnoRR+U+XXHWKBHeNy/+tZmM2kcAVGLOsz+yaDA= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= -github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/kataras/golog v0.0.10 h1:vRDRUmwacco/pmBAm8geLn8rHEdc+9Z4NAr5Sh7TG/4= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.1.8 h1:O3gJasjm7ZxpxwTH8tApZsvf274scSGQAUpNe47c37U= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.2 h1:6NAi+uPJ/Zuid6mrAKlgpbI11/zK/lV4B2rxWaJN98Y= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5 h1:4HCONX5RLgVy6G4RkYOV3vKNcma9p236LdGOipJsaFE= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= -github.com/klauspost/compress v1.4.0 h1:8nsMz3tWa9SWWPL60G1V6CUsf4lLjWLTNEtibhe8gh8= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7 h1:hYW1gP94JUmAhBtJ+LNz5My+gBobDxPR1iVuKug26aA= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.8 h1:VMAMUUOh+gaxKTMk+zqbjsSjsIcUcL/LF4o63i82QyA= -github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e h1:+lIPJOWl+jSiJOc70QXJ07+2eg2Jy2EC7Mi11BWujeM= -github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/labstack/echo v3.1.0+incompatible h1:O5EVu+57ejXk06fna+o6Z86S6+2QqPWeS0+eWiqb+Bs= -github.com/labstack/echo v3.1.0+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= -github.com/labstack/gommon v0.2.9 h1:heVeuAYtevIQVYkGj6A41dtfT91LrvFG220lavpWhrU= -github.com/labstack/gommon v0.2.9/go.mod h1:E8ZTmW9vw5az5/ZyHWCp0Lw4OH2ecsaBP1C/NKavGG4= -github.com/leodido/go-urn v1.1.0 h1:Sm1gr51B1kKyfD2BlRcLSiEkffoG96g6TPv6eRoEiB8= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2 h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/columnize v2.1.0+incompatible h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUWQxHW5TkBe7YUl+2s= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.0.0 h1:BwIoZQbBsTo3v2F5lz5Oy3TlTq4wLKTLV260EVTEWco= -github.com/valyala/fasthttp v1.0.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= -github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8= -github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.1.0 h1:ngVtJC9TY/lg0AA/1k48FYhBrhRoFlEmWzsehpNAaZg= -github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 h1:sKJQZMuxjOAR/Uo2LBfU90onWEf1dF4C+0hPJCc9Mpc= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed h1:uPxWBzB3+mlnjy9W58qY1j/cjyFjutgw/Vhan2zLy/A= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.0.0 h1:dN4LljjBKVChsv0XCSI+zbyzdqrkEwX5LQFUMRSGqOc= -google.golang.org/appengine v1.0.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1 h1:SvGtYmN60a5CVKTOzMSyfzWDeZRxRuGvRQyEAKbw1xc= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/ini.v1 v1.51.1 h1:GyboHr4UqMiLUybYjd22ZjQIKEJEpgtLXtuGbR21Oho= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce h1:xcEWjVhvbDy+nHP67nPDDpbYrY+ILlfndk4bRioVHaU= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2 h1:XZx7nhd5GMaZpmDaEHFVafUZC7ya0fuo7cSJ3UCKYmM= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -moul.io/http2curl v1.0.1-0.20190925090545-5cd742060b0e h1:C7q+e9M5nggAvWfVg9Nl66kebKeuJlP3FD58V4RR5wo= -moul.io/http2curl v1.0.1-0.20190925090545-5cd742060b0e/go.mod h1:nejbQVfXh96n9dSF6cH3Jsk/QI1Z2oEL7sSI2ifXFNA= diff --git a/_examples/iris.go b/_examples/iris.go index 9fd6f533b..c71572031 100644 --- a/_examples/iris.go +++ b/_examples/iris.go @@ -1,5 +1,3 @@ -// +build go1.14 - package examples import ( diff --git a/_examples/iris_test.go b/_examples/iris_test.go index 79d0aa20e..ce3860951 100644 --- a/_examples/iris_test.go +++ b/_examples/iris_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/gavv/httpexpect/v2" + "github.com/iris-contrib/httpexpect/v2" ) func irisTester(t *testing.T) *httpexpect.Expect { diff --git a/_examples/websocket.go b/_examples/websocket.go deleted file mode 100644 index cf25e2c55..000000000 --- a/_examples/websocket.go +++ /dev/null @@ -1,52 +0,0 @@ -package examples - -import ( - "net/http" - - "github.com/gorilla/websocket" - - fastwebsocket "github.com/fasthttp-contrib/websocket" - "github.com/valyala/fasthttp" -) - -// WsHttpHandler is a simple http.Handler that implements WebSocket echo server. -func WsHttpHandler(w http.ResponseWriter, r *http.Request) { - upgrader := &websocket.Upgrader{} - c, err := upgrader.Upgrade(w, r, nil) - if err != nil { - panic(err) - } - defer c.Close() - for { - mt, message, err := c.ReadMessage() - if err != nil { - break - } - err = c.WriteMessage(mt, message) - if err != nil { - break - } - } -} - -// WsFastHandler is a simple fasthttp.RequestHandler that implements -// WebSocket echo server. -func WsFastHandler(ctx *fasthttp.RequestCtx) { - upgrader := fastwebsocket.New(func(c *fastwebsocket.Conn) { - defer c.Close() - for { - mt, message, err := c.ReadMessage() - if err != nil { - break - } - err = c.WriteMessage(mt, message) - if err != nil { - break - } - } - }) - err := upgrader.Upgrade(ctx) - if err != nil { - panic(err) - } -} diff --git a/_examples/websocket_test.go b/_examples/websocket_test.go deleted file mode 100644 index 3e1fe1696..000000000 --- a/_examples/websocket_test.go +++ /dev/null @@ -1,119 +0,0 @@ -package examples - -import ( - "net/http" - "testing" - - "github.com/gavv/httpexpect/v2" - "github.com/gorilla/websocket" -) - -func wsHttpHandlerTester(t *testing.T) *httpexpect.Expect { - return httpexpect.WithConfig(httpexpect.Config{ - BaseURL: "ws://example.com", - WebsocketDialer: httpexpect.NewWebsocketDialer(http.HandlerFunc(WsHttpHandler)), - Reporter: httpexpect.NewAssertReporter(t), - Printers: []httpexpect.Printer{ - httpexpect.NewDebugPrinter(t, true), - }, - }) -} - -func TestWsHttpHandlerText(t *testing.T) { - e := wsHttpHandlerTester(t) - - ws := e.GET("/path").WithWebsocketUpgrade(). - Expect(). - Status(http.StatusSwitchingProtocols). - Websocket() - defer ws.Disconnect() - - ws.WriteText("hi"). - Expect(). - TextMessage().Body().Equal("hi") -} - -func TestWsHttpHandlerJSON(t *testing.T) { - e := wsHttpHandlerTester(t) - - ws := e.GET("/path").WithWebsocketUpgrade(). - Expect(). - Status(http.StatusSwitchingProtocols). - Websocket() - defer ws.Disconnect() - - ws.WriteJSON(struct { - Message string `json:"message"` - }{"hi"}). - Expect(). - TextMessage().JSON().Object().ValueEqual("message", "hi") -} - -func TestWsHttpHandlerClose(t *testing.T) { - e := wsHttpHandlerTester(t) - - ws := e.GET("/path").WithWebsocketUpgrade(). - Expect(). - Status(http.StatusSwitchingProtocols). - Websocket() - defer ws.Disconnect() - - ws.CloseWithText("Namárië...", websocket.CloseGoingAway). - Expect(). - CloseMessage().NoContent() -} - -func wsFastHandlerTester(t *testing.T) *httpexpect.Expect { - return httpexpect.WithConfig(httpexpect.Config{ - BaseURL: "http://example.com", - WebsocketDialer: httpexpect.NewFastWebsocketDialer(WsFastHandler), - Reporter: httpexpect.NewAssertReporter(t), - Printers: []httpexpect.Printer{ - httpexpect.NewDebugPrinter(t, true), - }, - }) -} - -func TestWsFastHandlerText(t *testing.T) { - e := wsFastHandlerTester(t) - - ws := e.GET("/path").WithWebsocketUpgrade(). - Expect(). - Status(http.StatusSwitchingProtocols). - Websocket() - defer ws.Disconnect() - - ws.WriteText("hi"). - Expect(). - TextMessage().Body().Equal("hi") -} - -func TestWsFastHandlerJSON(t *testing.T) { - e := wsFastHandlerTester(t) - - ws := e.GET("/path").WithWebsocketUpgrade(). - Expect(). - Status(http.StatusSwitchingProtocols). - Websocket() - defer ws.Disconnect() - - ws.WriteJSON(struct { - Message string `json:"message"` - }{"hi"}). - Expect(). - TextMessage().JSON().Object().ValueEqual("message", "hi") -} - -func TestWsFastHandlerClose(t *testing.T) { - e := wsFastHandlerTester(t) - - ws := e.GET("/path").WithWebsocketUpgrade(). - Expect(). - Status(http.StatusSwitchingProtocols). - Websocket() - defer ws.Disconnect() - - ws.CloseWithText("Namárië...", websocket.CloseGoingAway). - Expect(). - CloseMessage().NoContent() -} diff --git a/binder.go b/binder.go index d7d9baa6b..73a9b8653 100644 --- a/binder.go +++ b/binder.go @@ -5,11 +5,8 @@ import ( "crypto/tls" "fmt" "io/ioutil" - "net" "net/http" "net/http/httptest" - - "github.com/valyala/fasthttp" ) // Binder implements networkless http.RoundTripper attached directly to @@ -78,141 +75,3 @@ func (binder Binder) RoundTrip(req *http.Request) (*http.Response, error) { return &resp, nil } - -// FastBinder implements networkless http.RoundTripper attached directly -// to fasthttp.RequestHandler. -// -// FastBinder emulates network communication by invoking given fasthttp.RequestHandler -// directly. It converts http.Request to fasthttp.Request, invokes handler, and then -// converts fasthttp.Response to http.Response. -type FastBinder struct { - // FastHTTP handler invoked for every request. - Handler fasthttp.RequestHandler - // TLS connection state used for https:// requests. - TLS *tls.ConnectionState -} - -// NewFastBinder returns a new FastBinder given a fasthttp.RequestHandler. -// -// Example: -// client := &http.Client{ -// Transport: NewFastBinder(fasthandler), -// } -func NewFastBinder(handler fasthttp.RequestHandler) FastBinder { - return FastBinder{Handler: handler} -} - -// RoundTrip implements http.RoundTripper.RoundTrip. -func (binder FastBinder) RoundTrip(stdreq *http.Request) (*http.Response, error) { - fastreq := std2fast(stdreq) - - var conn net.Conn - if stdreq.URL != nil && stdreq.URL.Scheme == "https" && binder.TLS != nil { - conn = connTLS{state: binder.TLS} - } else { - conn = connNonTLS{} - } - - ctx := fasthttp.RequestCtx{} - ctx.Init2(conn, fastLogger{}, true) - fastreq.CopyTo(&ctx.Request) - - if stdreq.ContentLength >= 0 { - ctx.Request.Header.SetContentLength(int(stdreq.ContentLength)) - } else { - ctx.Request.Header.Add("Transfer-Encoding", "chunked") - } - - if stdreq.Body != nil { - b, err := ioutil.ReadAll(stdreq.Body) - if err == nil { - ctx.Request.SetBody(b) - } - } - - binder.Handler(&ctx) - - return fast2std(stdreq, &ctx.Response), nil -} - -func std2fast(stdreq *http.Request) *fasthttp.Request { - fastreq := &fasthttp.Request{} - fastreq.SetRequestURI(stdreq.URL.String()) - - fastreq.Header.SetMethod(stdreq.Method) - - for k, a := range stdreq.Header { - for n, v := range a { - if n == 0 { - fastreq.Header.Set(k, v) - } else { - fastreq.Header.Add(k, v) - } - } - } - - return fastreq -} - -func fast2std(stdreq *http.Request, fastresp *fasthttp.Response) *http.Response { - status := fastresp.Header.StatusCode() - body := fastresp.Body() - - stdresp := &http.Response{ - Request: stdreq, - StatusCode: status, - Status: http.StatusText(status), - } - - fastresp.Header.VisitAll(func(k, v []byte) { - sk := string(k) - sv := string(v) - if stdresp.Header == nil { - stdresp.Header = make(http.Header) - } - stdresp.Header.Add(sk, sv) - }) - - if fastresp.Header.ContentLength() == -1 { - stdresp.TransferEncoding = []string{"chunked"} - } - - if body != nil { - stdresp.Body = ioutil.NopCloser(bytes.NewReader(body)) - } else { - stdresp.Body = ioutil.NopCloser(bytes.NewReader(nil)) - } - - return stdresp -} - -type fastLogger struct{} - -func (fastLogger) Printf(format string, args ...interface{}) { - _, _ = format, args -} - -type connNonTLS struct { - net.Conn -} - -func (connNonTLS) RemoteAddr() net.Addr { - return &net.TCPAddr{IP: net.IPv4zero} -} - -func (connNonTLS) LocalAddr() net.Addr { - return &net.TCPAddr{IP: net.IPv4zero} -} - -type connTLS struct { - connNonTLS - state *tls.ConnectionState -} - -func (c connTLS) Handshake() error { - return nil -} - -func (c connTLS) ConnectionState() tls.ConnectionState { - return *c.state -} diff --git a/binder_test.go b/binder_test.go index d5f92b44c..24352e457 100644 --- a/binder_test.go +++ b/binder_test.go @@ -1,7 +1,6 @@ package httpexpect import ( - "bufio" "crypto/tls" "io/ioutil" "net/http" @@ -9,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/valyala/fasthttp" ) type mockHandler struct { @@ -166,205 +164,3 @@ func TestBinderChunked(t *testing.T) { assert.Equal(t, []string{"chunked"}, req.TransferEncoding) assert.Equal(t, []string{"chunked"}, resp.TransferEncoding) } - -func TestFastBinder(t *testing.T) { - handler := func(ctx *fasthttp.RequestCtx) { - assert.Equal(t, "POST", string(ctx.Request.Header.Method())) - assert.Equal(t, "http://example.com/path", string(ctx.Request.Header.RequestURI())) - - assert.Equal(t, "application/x-www-form-urlencoded", - string(ctx.Request.Header.ContentType())) - - headers := map[string][]string{} - - ctx.Request.Header.VisitAll(func(k, v []byte) { - headers[string(k)] = append(headers[string(k)], string(v)) - }) - - expected := map[string][]string{ - "Content-Type": {"application/x-www-form-urlencoded"}, - "Content-Length": {"7"}, - "Some-Header": {"foo", "bar"}, - } - - assert.Equal(t, expected, headers) - - assert.Equal(t, "bar", string(ctx.FormValue("foo"))) - assert.Equal(t, "foo=bar", string(ctx.Request.Body())) - - ctx.Response.Header.Set("Content-Type", "application/json") - ctx.Response.SetBody([]byte(`{"hello":"world"}`)) - } - - client := &http.Client{ - Transport: NewFastBinder(handler), - } - - req, err := http.NewRequest( - "POST", "http://example.com/path", strings.NewReader("foo=bar")) - - if err != nil { - t.Fatal(err) - } - - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - req.Header.Add("Some-Header", "foo") - req.Header.Add("Some-Header", "bar") - - resp, err := client.Do(req) - if err != nil { - t.Fatal(err) - } - - header := http.Header{ - "Content-Type": {"application/json"}, - } - - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - assert.Equal(t, header, resp.Header) - assert.Equal(t, `{"hello":"world"}`, string(b)) - - assert.Equal(t, []string(nil), resp.TransferEncoding) -} - -func TestFastBinderTLS(t *testing.T) { - var isHTTPS, isTLS bool - - tlsState := &tls.ConnectionState{} - - handler := func(ctx *fasthttp.RequestCtx) { - isHTTPS = strings.HasPrefix(string(ctx.Request.Header.RequestURI()), "https://") - isTLS = ctx.IsTLS() - if isTLS { - assert.Equal(t, *tlsState, *ctx.TLSConnectionState()) - } - } - - httpClient := &http.Client{ - Transport: &FastBinder{ - Handler: handler, - TLS: nil, - }, - } - - httpsClient := &http.Client{ - Transport: &FastBinder{ - Handler: handler, - TLS: tlsState, - }, - } - - req, _ := http.NewRequest("GET", "http://example.com/path", strings.NewReader("body")) - resp, err := httpClient.Do(req) - assert.Nil(t, err) - assert.NotNil(t, resp) - assert.False(t, isHTTPS) - assert.False(t, isTLS) - - req, _ = http.NewRequest("GET", "https://example.com/path", strings.NewReader("body")) - resp, err = httpClient.Do(req) - assert.Nil(t, err) - assert.NotNil(t, resp) - assert.True(t, isHTTPS) - assert.False(t, isTLS) - - req, _ = http.NewRequest("GET", "http://example.com/path", strings.NewReader("body")) - resp, err = httpsClient.Do(req) - assert.Nil(t, err) - assert.NotNil(t, resp) - assert.False(t, isHTTPS) - assert.False(t, isTLS) - - req, _ = http.NewRequest("GET", "https://example.com/path", strings.NewReader("body")) - resp, err = httpsClient.Do(req) - assert.Nil(t, err) - assert.NotNil(t, resp) - assert.True(t, isHTTPS) - assert.True(t, isTLS) -} - -func TestFastBinderChunked(t *testing.T) { - handler := func(ctx *fasthttp.RequestCtx) { - assert.Equal(t, "POST", string(ctx.Request.Header.Method())) - assert.Equal(t, "http://example.com/path", string(ctx.Request.Header.RequestURI())) - - assert.Equal(t, "application/x-www-form-urlencoded", - string(ctx.Request.Header.ContentType())) - - headers := map[string][]string{} - - ctx.Request.Header.VisitAll(func(k, v []byte) { - headers[string(k)] = append(headers[string(k)], string(v)) - }) - - expected := map[string][]string{ - "Content-Type": {"application/x-www-form-urlencoded"}, - "Transfer-Encoding": {"chunked"}, - } - - assert.Equal(t, expected, headers) - - assert.Equal(t, "bar", string(ctx.FormValue("foo"))) - assert.Equal(t, "foo=bar", string(ctx.Request.Body())) - - ctx.Response.Header.Set("Content-Type", "application/json") - ctx.Response.SetBodyStreamWriter(func(w *bufio.Writer) { - _, _ = w.WriteString(`[1, `) - _ = w.Flush() - _, _ = w.WriteString(`2]`) - }) - } - - client := &http.Client{ - Transport: NewFastBinder(handler), - } - - req, err := http.NewRequest( - "POST", "http://example.com/path", strings.NewReader("foo=bar")) - - if err != nil { - t.Fatal(err) - } - - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - - req.ContentLength = -1 - - resp, err := client.Do(req) - if err != nil { - t.Fatal(err) - } - - assert.Equal(t, []string{"chunked"}, resp.TransferEncoding) -} - -func TestFastBinderEmptyResponse(t *testing.T) { - handler := func(*fasthttp.RequestCtx) {} - - client := &http.Client{ - Transport: NewFastBinder(handler), - } - - req, err := http.NewRequest("POST", "http://example.com/path", nil) - if err != nil { - t.Fatal(err) - } - - resp, err := client.Do(req) - if err != nil { - t.Fatal(err) - } - - assert.False(t, resp.Body == nil) - - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - - assert.Equal(t, "", string(b)) -} diff --git a/e2e_basic_test.go b/e2e_basic_test.go index 3f2dadef0..45ef5bac0 100644 --- a/e2e_basic_test.go +++ b/e2e_basic_test.go @@ -6,8 +6,6 @@ import ( "net/http" "net/http/httptest" "testing" - - "github.com/valyala/fasthttp/fasthttpadaptor" ) func createBasicHandler() http.Handler { @@ -163,15 +161,3 @@ func TestE2EBasicBinderStandard(t *testing.T) { }, })) } - -func TestE2EBasicBinderFast(t *testing.T) { - handler := fasthttpadaptor.NewFastHTTPHandler(createBasicHandler()) - - testBasicHandler(WithConfig(Config{ - BaseURL: "http://example.com", - Reporter: NewAssertReporter(t), - Client: &http.Client{ - Transport: NewFastBinder(handler), - }, - })) -} diff --git a/e2e_chunked_test.go b/e2e_chunked_test.go index 12b7e0a22..0d6de4dbe 100644 --- a/e2e_chunked_test.go +++ b/e2e_chunked_test.go @@ -1,14 +1,10 @@ package httpexpect import ( - "bufio" "net/http" "net/http/httptest" "strings" "testing" - - "github.com/stretchr/testify/assert" - "github.com/valyala/fasthttp" ) func createChunkedHandler() http.Handler { @@ -33,27 +29,6 @@ func createChunkedHandler() http.Handler { return mux } -func createChunkedFastHandler(t *testing.T) fasthttp.RequestHandler { - return func(ctx *fasthttp.RequestCtx) { - headers := map[string][]string{} - - ctx.Request.Header.VisitAll(func(k, v []byte) { - headers[string(k)] = append(headers[string(k)], string(v)) - }) - - assert.Equal(t, []string{"chunked"}, headers["Transfer-Encoding"]) - assert.Equal(t, "value", string(ctx.FormValue("key"))) - assert.Equal(t, "key=value", string(ctx.Request.Body())) - - ctx.Response.Header.Set("Content-Type", "application/json") - ctx.Response.SetBodyStreamWriter(func(w *bufio.Writer) { - _, _ = w.WriteString(`[1, `) - _ = w.Flush() - _, _ = w.WriteString(`2]`) - }) - } -} - func testChunkedHandler(e *Expect) { e.PUT("/"). WithHeader("Content-Type", "application/x-www-form-urlencoded"). @@ -85,15 +60,3 @@ func TestE2EChunkedBinderStandard(t *testing.T) { }, })) } - -func TestE2EChunkedBinderFast(t *testing.T) { - handler := createChunkedFastHandler(t) - - testChunkedHandler(WithConfig(Config{ - BaseURL: "http://example.com", - Reporter: NewAssertReporter(t), - Client: &http.Client{ - Transport: NewFastBinder(handler), - }, - })) -} diff --git a/e2e_cookie_test.go b/e2e_cookie_test.go index af34c46ec..e3e768acf 100644 --- a/e2e_cookie_test.go +++ b/e2e_cookie_test.go @@ -5,8 +5,6 @@ import ( "net/http/httptest" "testing" "time" - - "github.com/valyala/fasthttp/fasthttpadaptor" ) func createCookieHandler() http.Handler { @@ -114,33 +112,3 @@ func TestE2ECookieBinderStandardEnabled(t *testing.T) { testCookieHandler(e, true) } - -func TestE2ECookieBinderFastDisabled(t *testing.T) { - handler := fasthttpadaptor.NewFastHTTPHandler(createCookieHandler()) - - e := WithConfig(Config{ - BaseURL: "http://example.com", - Reporter: NewAssertReporter(t), - Client: &http.Client{ - Transport: NewFastBinder(handler), - Jar: nil, - }, - }) - - testCookieHandler(e, false) -} - -func TestE2ECookieBinderFastEnabled(t *testing.T) { - handler := fasthttpadaptor.NewFastHTTPHandler(createCookieHandler()) - - e := WithConfig(Config{ - BaseURL: "http://example.com", - Reporter: NewAssertReporter(t), - Client: &http.Client{ - Transport: NewFastBinder(handler), - Jar: NewJar(), - }, - }) - - testCookieHandler(e, true) -} diff --git a/e2e_fs_test.go b/e2e_fs_test.go deleted file mode 100644 index 40733ccc9..000000000 --- a/e2e_fs_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package httpexpect - -import ( - "io/ioutil" - "net/http" - "os" - "path" - "testing" - - "github.com/valyala/fasthttp" -) - -func TestE2EFsFastBinder(t *testing.T) { - tempdir, err := ioutil.TempDir("", "httpexpect") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(tempdir) - - if err := ioutil.WriteFile( - path.Join(tempdir, "hello"), []byte("hello, world!"), 0666); err != nil { - t.Fatal(err) - } - - fs := &fasthttp.FS{ - Root: tempdir, - } - - handler := fs.NewRequestHandler() - - e := WithConfig(Config{ - Client: &http.Client{ - Transport: NewFastBinder(handler), - Jar: NewJar(), - }, - Reporter: NewAssertReporter(t), - Printers: []Printer{ - NewDebugPrinter(t, true), - }, - }) - - e.GET("/hello"). - Expect(). - Status(http.StatusOK). - Text().Equal("hello, world!") -} diff --git a/e2e_redirect_test.go b/e2e_redirect_test.go index ea100dec7..fd2595bc1 100644 --- a/e2e_redirect_test.go +++ b/e2e_redirect_test.go @@ -4,8 +4,6 @@ import ( "net/http" "net/http/httptest" "testing" - - "github.com/valyala/fasthttp" ) func createRedirectHandler() http.Handler { @@ -22,18 +20,6 @@ func createRedirectHandler() http.Handler { return mux } -func createRedirectFastHandler() fasthttp.RequestHandler { - return func(ctx *fasthttp.RequestCtx) { - switch string(ctx.Path()) { - case "/foo": - ctx.SetBody([]byte(`hello`)) - - case "/bar": - ctx.Redirect("/foo", http.StatusFound) - } - } -} - func testRedirectHandler(e *Expect) { e.POST("/bar"). Expect(). @@ -60,15 +46,3 @@ func TestE2ERedirectBinderStandard(t *testing.T) { }, })) } - -func TestE2ERedirectBinderFast(t *testing.T) { - handler := createRedirectFastHandler() - - testRedirectHandler(WithConfig(Config{ - BaseURL: "http://example.com", - Reporter: NewAssertReporter(t), - Client: &http.Client{ - Transport: NewFastBinder(handler), - }, - })) -} diff --git a/e2e_tls_test.go b/e2e_tls_test.go index eee6a608e..065177981 100644 --- a/e2e_tls_test.go +++ b/e2e_tls_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/valyala/fasthttp" ) func createAutoTLSHandler(https string) http.Handler { @@ -33,26 +32,6 @@ func createAutoTLSHandler(https string) http.Handler { return mux } -func createAutoTLSFastHandler(https string) fasthttp.RequestHandler { - return func(ctx *fasthttp.RequestCtx) { - switch string(ctx.Path()) { - case "/tls": - if !ctx.IsTLS() { - ctx.SetBody([]byte(`no`)) - } else { - ctx.SetBody([]byte(`yes`)) - } - - case "/protected": - if !ctx.IsTLS() { - ctx.Redirect(https+string(ctx.Request.RequestURI()), http.StatusFound) - } else { - ctx.SetBody([]byte(`hello`)) - } - } - } -} - func testAutoTLSHandler(config Config) { e := WithConfig(config) @@ -118,23 +97,3 @@ func TestE2EAutoTLSBinderStandard(t *testing.T) { }) } } - -func TestE2EAutoTLSBinderFast(t *testing.T) { - handler := createAutoTLSFastHandler("https://example.com") - - for _, url := range []string{"https://example.com", "http://example.com"} { - testAutoTLSHandler(Config{ - BaseURL: url, - Reporter: NewRequireReporter(t), - Printers: []Printer{ - NewDebugPrinter(t, true), - }, - Client: &http.Client{ - Transport: &FastBinder{ - Handler: handler, - TLS: &tls.ConnectionState{}, - }, - }, - }) - } -} diff --git a/e2e_websocket_test.go b/e2e_websocket_test.go index db3732561..726130fbf 100644 --- a/e2e_websocket_test.go +++ b/e2e_websocket_test.go @@ -6,9 +6,7 @@ import ( "testing" "time" - fastwebsocket "github.com/fasthttp-contrib/websocket" "github.com/gorilla/websocket" - "github.com/valyala/fasthttp" ) type wsHandlerOpts struct { @@ -47,26 +45,6 @@ func createWebsocketHandler(opts wsHandlerOpts) http.Handler { return mux } -func websocketFastHandler(ctx *fasthttp.RequestCtx) { - upgrader := fastwebsocket.New(func(c *fastwebsocket.Conn) { - defer c.Close() - for { - mt, message, err := c.ReadMessage() - if err != nil { - break - } - err = c.WriteMessage(mt, message) - if err != nil { - break - } - } - }) - err := upgrader.Upgrade(ctx) - if err != nil { - panic(err) - } -} - func testWebsocketSession(e *Expect) { ws := e.GET("/test").WithWebsocketUpgrade(). Expect(). @@ -172,33 +150,6 @@ func TestE2EWebsocketHandlerStandard(t *testing.T) { }) } -func TestE2EWebsocketHandlerFast(t *testing.T) { - t.Run("dialer-config", func(t *testing.T) { - e := WithConfig(Config{ - Reporter: NewAssertReporter(t), - WebsocketDialer: NewFastWebsocketDialer(websocketFastHandler), - Printers: []Printer{ - NewDebugPrinter(t, true), - }, - }) - - testWebsocket(e) - }) - - t.Run("dialer-method", func(t *testing.T) { - e := WithConfig(Config{ - Reporter: NewAssertReporter(t), - Printers: []Printer{ - NewDebugPrinter(t, true), - }, - }) - - testWebsocket(e.Builder(func(req *Request) { - req.WithWebsocketDialer(NewFastWebsocketDialer(websocketFastHandler)) - })) - }) -} - func testWebsocketTimeout( t *testing.T, handler http.Handler, diff --git a/expect.go b/expect.go index 4962e8764..8d652c6b4 100644 --- a/expect.go +++ b/expect.go @@ -3,8 +3,8 @@ // Usage examples // // See example directory: -// - https://godoc.org/github.com/gavv/httpexpect/_examples -// - https://github.com/gavv/httpexpect/tree/master/_examples +// - https://godoc.org/github.com/iris-contrib/httpexpect/_examples +// - https://github.com/gavv/iris-contrib/tree/master/_examples // // Communication mode // @@ -20,10 +20,6 @@ // the following: // 1. default (nil) - use HTTP transport from net/http (you should start server) // 2. httpexpect.Binder - invoke given http.Handler directly -// 3. httpexpect.FastBinder - invoke given fasthttp.RequestHandler directly -// -// Note that http handler can be usually obtained from http framework you're using. -// E.g., echo framework provides either http.Handler or fasthttp.RequestHandler. // // You can also provide your own implementation of RequestFactory (creates http.Request), // or Client (gets http.Request and returns http.Response). @@ -146,9 +142,6 @@ type RequestFactory interface { // httpBinderClient := &http.Client{ // Transport: httpexpect.NewBinder(HTTPHandler), // } -// fastBinderClient := &http.Client{ -// Transport: httpexpect.NewFastBinder(FastHTTPHandler), -// } type Client interface { // Do sends request and returns response. Do(*http.Request) (*http.Response, error) diff --git a/go.mod b/go.mod index 32797a4bc..d9c1f6717 100644 --- a/go.mod +++ b/go.mod @@ -1,29 +1,19 @@ -module github.com/gavv/httpexpect/v2 +module github.com/iris-contrib/httpexpect/v2 -go 1.12 +go 1.14 require ( github.com/ajg/form v1.5.1 - github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 - github.com/fatih/structs v1.0.0 + github.com/fatih/structs v1.1.0 github.com/google/go-querystring v1.0.0 - github.com/gorilla/websocket v1.0.0 - github.com/imkira/go-interpol v1.0.0 - github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect - github.com/mattn/go-colorable v0.1.2 // indirect - github.com/onsi/ginkgo v1.10.1 // indirect - github.com/onsi/gomega v1.7.0 // indirect - github.com/sergi/go-diff v1.0.0 // indirect - github.com/stretchr/testify v1.3.0 - github.com/valyala/fasthttp v1.0.0 - github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect - github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - github.com/xeipuuv/gojsonschema v1.1.0 + github.com/gorilla/websocket v1.4.2 + github.com/imkira/go-interpol v1.1.0 + github.com/sergi/go-diff v1.1.0 // indirect + github.com/stretchr/testify v1.5.1 + github.com/xeipuuv/gojsonschema v1.2.0 github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 github.com/yudai/gojsondiff v1.0.0 github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect - github.com/yudai/pp v2.0.1+incompatible // indirect - golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 - gopkg.in/yaml.v2 v2.2.2 // indirect - moul.io/http2curl v1.0.1-0.20190925090545-5cd742060b0e + golang.org/x/net v0.0.0-20200506145744-7e3656a0809f + moul.io/http2curl v1.0.0 ) diff --git a/go.sum b/go.sum index 970f9757b..30339eea9 100644 --- a/go.sum +++ b/go.sum @@ -1,86 +1,35 @@ -github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/structs v1.0.0 h1:BrX964Rv5uQ3wwS+KRUAJCBBw5PQmgJfJ6v4yly5QwU= -github.com/fatih/structs v1.0.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/gorilla/websocket v1.0.0 h1:J/mA+d2LqcDKjAEhQjXDHt9/e7Cnm+oBUwgHp5C6XDg= -github.com/gorilla/websocket v1.0.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imkira/go-interpol v1.0.0 h1:HrmLyvOLJyjR0YofMw8QGdCIuYOs4TJUBDNU5sJC09E= -github.com/imkira/go-interpol v1.0.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/klauspost/compress v1.4.0 h1:8nsMz3tWa9SWWPL60G1V6CUsf4lLjWLTNEtibhe8gh8= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e h1:+lIPJOWl+jSiJOc70QXJ07+2eg2Jy2EC7Mi11BWujeM= -github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.0.0 h1:BwIoZQbBsTo3v2F5lz5Oy3TlTq4wLKTLV260EVTEWco= -github.com/valyala/fasthttp v1.0.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.1.0 h1:ngVtJC9TY/lg0AA/1k48FYhBrhRoFlEmWzsehpNAaZg= -github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= -github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f h1:QBjCr1Fz5kw158VqdE9JfI9cJnl/ymnJWAdMuinqL7Y= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -moul.io/http2curl v1.0.1-0.20190925090545-5cd742060b0e h1:C7q+e9M5nggAvWfVg9Nl66kebKeuJlP3FD58V4RR5wo= -moul.io/http2curl v1.0.1-0.20190925090545-5cd742060b0e/go.mod h1:nejbQVfXh96n9dSF6cH3Jsk/QI1Z2oEL7sSI2ifXFNA= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8= +moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE= diff --git a/websocket_dialer.go b/websocket_dialer.go index 8cc10d745..be0782c9b 100644 --- a/websocket_dialer.go +++ b/websocket_dialer.go @@ -8,7 +8,6 @@ import ( "sync" "github.com/gorilla/websocket" - "github.com/valyala/fasthttp" ) // NewWebsocketDialer produces new websocket.Dialer which dials to bound @@ -23,18 +22,6 @@ func NewWebsocketDialer(handler http.Handler) *websocket.Dialer { } } -// NewFastWebsocketDialer produces new websocket.Dialer which dials to bound -// fasthttp.RequestHandler without creating a real net.Conn. -func NewFastWebsocketDialer(handler fasthttp.RequestHandler) *websocket.Dialer { - return &websocket.Dialer{ - NetDial: func(network, addr string) (net.Conn, error) { - hc := newHandlerConn() - hc.runFastHandler(handler) - return hc, nil - }, - } -} - type handlerConn struct { net.Conn // returned from dialer backConn net.Conn // passed to the background goroutine @@ -75,16 +62,6 @@ func (hc *handlerConn) runHandler(handler http.Handler) { }() } -func (hc *handlerConn) runFastHandler(handler fasthttp.RequestHandler) { - hc.wg.Add(1) - - go func() { - defer hc.wg.Done() - - _ = fasthttp.ServeConn(hc.backConn, handler) - }() -} - // hijackRecorder it similar to httptest.ResponseRecorder, // but with Hijack capabilities. //