🙌 make utils public

Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
pull/774/head
Fenny 2020-09-14 12:12:29 +02:00
parent b32c793886
commit 2768ea2a77
30 changed files with 33 additions and 29 deletions

2
app.go
View File

@ -25,7 +25,7 @@ import (
"github.com/gofiber/fiber/v2/internal/colorable" "github.com/gofiber/fiber/v2/internal/colorable"
"github.com/gofiber/fiber/v2/internal/isatty" "github.com/gofiber/fiber/v2/internal/isatty"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -20,7 +20,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
"github.com/valyala/fasthttp/fasthttputil" "github.com/valyala/fasthttp/fasthttputil"
) )

2
ctx.go
View File

@ -22,7 +22,7 @@ import (
"github.com/gofiber/fiber/v2/internal/bytebufferpool" "github.com/gofiber/fiber/v2/internal/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/encoding/json" "github.com/gofiber/fiber/v2/internal/encoding/json"
"github.com/gofiber/fiber/v2/internal/schema" "github.com/gofiber/fiber/v2/internal/schema"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -25,7 +25,7 @@ import (
"time" "time"
"github.com/gofiber/fiber/v2/internal/bytebufferpool" "github.com/gofiber/fiber/v2/internal/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

3
go.mod
View File

@ -3,6 +3,7 @@ module github.com/gofiber/fiber/v2
go 1.14 go 1.14
require ( require (
github.com/klauspost/compress v1.11.0 // indirect
github.com/valyala/fasthttp v1.16.0 github.com/valyala/fasthttp v1.16.0
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 golang.org/x/sys v0.0.0-20200909081042-eff7692f9009
) )

5
go.sum
View File

@ -1,8 +1,9 @@
github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4=
github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
github.com/gofiber/fiber v1.14.6 h1:QRUPvPmr8ijQuGo1MgupHBn8E+wW0IKqiOvIZPtV70o=
github.com/klauspost/compress v1.10.7 h1:7rix8v8GpI3ZBb0nSozFRgbtXKv+hOe+qfEpZqybrAg= github.com/klauspost/compress v1.10.7 h1:7rix8v8GpI3ZBb0nSozFRgbtXKv+hOe+qfEpZqybrAg=
github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.0 h1:wJbzvpYMVGG9iTI9VxpnNZfd4DzMPoCWze3GgSqz8yg=
github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= 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/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.16.0 h1:9zAqOYLl8Tuy3E5R6ckzGDJ1g8+pw15oQp2iL9Jl6gQ= github.com/valyala/fasthttp v1.16.0 h1:9zAqOYLl8Tuy3E5R6ckzGDJ1g8+pw15oQp2iL9Jl6gQ=
@ -18,5 +19,7 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20u
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y=
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 h1:W0lCpv29Hv0UaM1LXb9QlBHLNP8UFfcKjblhVCWftOM=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 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.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

View File

@ -19,7 +19,7 @@ import (
"unsafe" "unsafe"
"github.com/gofiber/fiber/v2/internal/bytebufferpool" "github.com/gofiber/fiber/v2/internal/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -9,7 +9,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -5,7 +5,7 @@ import (
"strings" "strings"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// Config defines the config for middleware. // Config defines the config for middleware.

View File

@ -9,7 +9,7 @@ import (
b64 "encoding/base64" b64 "encoding/base64"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
func Test_Middleware_BasicAuth(t *testing.T) { func Test_Middleware_BasicAuth(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"testing" "testing"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
var filedata []byte var filedata []byte

View File

@ -4,7 +4,7 @@ import (
"testing" "testing"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -7,7 +7,7 @@ import (
"time" "time"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// Config defines the config for middleware. // Config defines the config for middleware.

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// go test -run Test_FileSystem // go test -run Test_FileSystem

View File

@ -9,7 +9,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"

View File

@ -7,7 +7,7 @@ import (
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/bytebufferpool" "github.com/gofiber/fiber/v2/internal/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// go test -run Test_Logger // go test -run Test_Logger

View File

@ -8,7 +8,7 @@ import (
"testing" "testing"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// go test -run Test_Proxy_Empty_Host // go test -run Test_Proxy_Empty_Host

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// go test -run Test_Recover // go test -run Test_Recover

View File

@ -2,7 +2,7 @@ package requestid
import ( import (
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// Config defines the config for middleware. // Config defines the config for middleware.

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// go test -run Test_RequestID // go test -run Test_RequestID

View File

@ -10,7 +10,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// routeParser holds the path segments and param names // routeParser holds the path segments and param names

View File

@ -8,7 +8,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
// go test -race -run Test_Path_parseRoute // go test -race -run Test_Path_parseRoute

View File

@ -7,7 +7,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
) )
func Test_App_Prefork_Child_Process(t *testing.T) { func Test_App_Prefork_Child_Process(t *testing.T) {

View File

@ -10,7 +10,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -13,7 +13,7 @@ import (
"net/http/httptest" "net/http/httptest"
"testing" "testing"
"github.com/gofiber/fiber/v2/internal/utils" "github.com/gofiber/fiber/v2/utils"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
) )

View File

@ -16,9 +16,9 @@ import (
func Test_Utils_FunctionName(t *testing.T) { func Test_Utils_FunctionName(t *testing.T) {
t.Parallel() t.Parallel()
AssertEqual(t, "github.com/gofiber/fiber/v2/internal/utils.Test_Utils_UUID", FunctionName(Test_Utils_UUID)) AssertEqual(t, "github.com/gofiber/fiber/v2/utils.Test_Utils_UUID", FunctionName(Test_Utils_UUID))
AssertEqual(t, "github.com/gofiber/fiber/v2/internal/utils.Test_Utils_FunctionName.func1", FunctionName(func() {})) AssertEqual(t, "github.com/gofiber/fiber/v2/utils.Test_Utils_FunctionName.func1", FunctionName(func() {}))
var dummyint = 20 var dummyint = 20
AssertEqual(t, "int", FunctionName(dummyint)) AssertEqual(t, "int", FunctionName(dummyint))