Skip to content

Commit

Permalink
🔦 move utils to internal
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenny committed Sep 14, 2020
1 parent 816547f commit a3cac71
Show file tree
Hide file tree
Showing 92 changed files with 42 additions and 40 deletions.
7 changes: 4 additions & 3 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"sync"
"time"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/utils/colorable"
"github.com/gofiber/fiber/v2/utils/isatty"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/gofiber/fiber/v2/internal/utils/colorable"
"github.com/gofiber/fiber/v2/internal/utils/isatty"

"github.com/valyala/fasthttp"
)

Expand Down
2 changes: 1 addition & 1 deletion app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"
"time"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/valyala/fasthttp"
"github.com/valyala/fasthttp/fasthttputil"
)
Expand Down
10 changes: 5 additions & 5 deletions ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"text/template"
"time"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/utils/bytebufferpool"
"github.com/gofiber/fiber/v2/utils/encoding/json"
"github.com/gofiber/fiber/v2/utils/schema"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/gofiber/fiber/v2/internal/utils/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/utils/encoding/json"
"github.com/gofiber/fiber/v2/internal/utils/schema"
"github.com/valyala/fasthttp"
)

Expand Down Expand Up @@ -612,7 +612,7 @@ func (c *Ctx) Next() (err error) {
return
}

// OriginalURL contains the original request URL.
// OriginalURL contains the original request URL. URI without scheme and host
// Returned value is only valid within the handler. Do not store any references.
// Make copies or use the Immutable setting to use the value outside the Handler.
func (c *Ctx) OriginalURL() string {
Expand Down
4 changes: 2 additions & 2 deletions ctx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"text/template"
"time"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/utils/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/valyala/fasthttp"
)

Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4=
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/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"os"

_ "github.com/gofiber/fiber/v2/utils/isatty"
_ "github.com/gofiber/fiber/v2/internal/utils/isatty"
)

// NewColorable returns new instance of Writer which handles escape sequence.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"os"

_ "github.com/gofiber/fiber/v2/utils/isatty"
_ "github.com/gofiber/fiber/v2/internal/utils/isatty"
)

// NewColorable returns new instance of Writer which handles escape sequence.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"syscall"
"unsafe"

"github.com/gofiber/fiber/v2/utils/isatty"
"github.com/gofiber/fiber/v2/internal/utils/isatty"
)

const (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"unicode/utf16"
"unicode/utf8"

"github.com/gofiber/fiber/v2/utils/encoding/ascii"
"github.com/gofiber/fiber/v2/internal/utils/encoding/ascii"
)

// All spaces characters defined in the json specification.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion middleware/basicauth/basicauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

// Config defines the config for middleware.
Expand Down
2 changes: 1 addition & 1 deletion middleware/basicauth/basicauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
b64 "encoding/base64"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

func Test_Middleware_BasicAuth(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion middleware/compress/compress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

var filedata []byte
Expand Down
2 changes: 1 addition & 1 deletion middleware/cors/cors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/valyala/fasthttp"
)

Expand Down
2 changes: 1 addition & 1 deletion middleware/csrf/csrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

// Config defines the config for middleware.
Expand Down
2 changes: 1 addition & 1 deletion middleware/csrf/csrf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/valyala/fasthttp"
)

Expand Down
2 changes: 1 addition & 1 deletion middleware/favicon/favicon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/valyala/fasthttp"
)

Expand Down
2 changes: 1 addition & 1 deletion middleware/filesystem/filesystem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

// go test -run Test_FileSystem
Expand Down
2 changes: 1 addition & 1 deletion middleware/limiter/limiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"

"github.com/gofiber/fiber/v2"
"github.com/valyala/fasthttp"
Expand Down
4 changes: 2 additions & 2 deletions middleware/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"time"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils/bytebufferpool"
"github.com/gofiber/fiber/v2/utils/fasttemplate"
"github.com/gofiber/fiber/v2/internal/utils/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/utils/fasttemplate"
)

// Config defines the config for middleware.
Expand Down
4 changes: 2 additions & 2 deletions middleware/logger/logger__test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/utils/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/gofiber/fiber/v2/internal/utils/bytebufferpool"
)

// go test -run Test_Logger
Expand Down
2 changes: 1 addition & 1 deletion middleware/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

// go test -run Test_Proxy_Empty_Host
Expand Down
2 changes: 1 addition & 1 deletion middleware/recover/recover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

// go test -run Test_Recover
Expand Down
2 changes: 1 addition & 1 deletion middleware/requestid/requestid.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package requestid

import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

// Config defines the config for middleware.
Expand Down
2 changes: 1 addition & 1 deletion middleware/requestid/requestid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

// go test -run Test_RequestID
Expand Down
2 changes: 1 addition & 1 deletion path.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
"strings"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

// routeParser holds the path segments and param names
Expand Down
2 changes: 1 addition & 1 deletion path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"testing"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

// go test -race -run Test_Path_parseRoute
Expand Down
2 changes: 1 addition & 1 deletion prefork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
)

func Test_App_Prefork_Child_Process(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion router.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/valyala/fasthttp"
)

Expand Down
2 changes: 1 addition & 1 deletion router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"net/http/httptest"
"testing"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/valyala/fasthttp"
)

Expand Down
4 changes: 2 additions & 2 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"time"
"unsafe"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/utils/bytebufferpool"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/gofiber/fiber/v2/internal/utils/bytebufferpool"
"github.com/valyala/fasthttp"
)

Expand Down
2 changes: 1 addition & 1 deletion utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/gofiber/fiber/v2/utils"
"github.com/gofiber/fiber/v2/internal/utils"
"github.com/valyala/fasthttp"
)

Expand Down

0 comments on commit a3cac71

Please sign in to comment.