Skip to content

Commit

Permalink
v6
Browse files Browse the repository at this point in the history
  • Loading branch information
burgesQ committed Aug 28, 2023
1 parent 210c802 commit 94b1e26
Show file tree
Hide file tree
Showing 37 changed files with 57 additions and 57 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
[8]:https://gitlab.frafos.net/gommon/webfmwk/-/commits/master

[11]:https://github.com/burgesQ/webfmwk/workflows/GoTest/badge.svg
[12]:https://godoc.org/github.com/burgesQ/webfmwk/v5?status.svg
[12]:https://godoc.org/github.com/burgesQ/webfmwk/v6?status.svg
[13]:https://codecov.io/gh/burgesQ/webfmwk/branch/master/graph/badge.svg
[14]:https://goreportcard.com/badge/github.com/burgesQ/webfmwk
[15]:https://img.shields.io/badge/compatible%20with-go1.19+-5272b4.svg
Expand Down Expand Up @@ -50,7 +50,7 @@ structure validation and error translation

## Use it

Import `github.com/burgesQ/webfmwk/v5`.
Import `github.com/burgesQ/webfmwk/v6`.

### Important

Expand All @@ -69,7 +69,7 @@ package main
import (
"net/http"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

// curl -X GET 127.0.0.1:4242/hello
Expand Down
2 changes: 1 addition & 1 deletion address.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strconv"

"github.com/burgesQ/webfmwk/v5/tls"
"github.com/burgesQ/webfmwk/v6/tls"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package webfmwk
import (
"testing"

"github.com/burgesQ/webfmwk/v5/tls"
"github.com/burgesQ/webfmwk/v6/tls"
"github.com/stretchr/testify/require"
)

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

"github.com/burgesQ/gommon/webtest"
"github.com/burgesQ/webfmwk/v5/log"
"github.com/burgesQ/webfmwk/v6/log"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Hello world example:
package main
import (
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)
// Handler
Expand Down
2 changes: 1 addition & 1 deletion example/custom_context.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/burgesQ/webfmwk/v5"
import "github.com/burgesQ/webfmwk/v6"

// customContext extend the webfmwk.Context
type ctx struct {
Expand Down
4 changes: 2 additions & 2 deletions example/custom_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"time"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v5/log"
"github.com/burgesQ/webfmwk/v6"
"github.com/burgesQ/webfmwk/v6/log"
)

func customWorker() *webfmwk.Server {
Expand Down
6 changes: 3 additions & 3 deletions example/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"fmt"
"os"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v5/log"
wtls "github.com/burgesQ/webfmwk/v5/tls"
"github.com/burgesQ/webfmwk/v6"
"github.com/burgesQ/webfmwk/v6/log"
wtls "github.com/burgesQ/webfmwk/v6/tls"
)

type (
Expand Down
6 changes: 3 additions & 3 deletions example/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module example

go 1.19
go 1.21

require github.com/burgesQ/webfmwk/v5 v5.0.0-beta
require github.com/burgesQ/webfmwk/v6 v6.0.0

require (
github.com/andybalholm/brotli v1.0.4 // indirect
Expand All @@ -25,4 +25,4 @@ require (
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect
)

replace github.com/burgesQ/webfmwk/v5 => ../
replace github.com/burgesQ/webfmwk/v6 => ../
6 changes: 3 additions & 3 deletions example/handlers.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v5/handler/logging"
"github.com/burgesQ/webfmwk/v5/handler/security"
"github.com/burgesQ/webfmwk/v6"
"github.com/burgesQ/webfmwk/v6/handler/logging"
"github.com/burgesQ/webfmwk/v6/handler/security"
)

// Handlers implement webfmwk.Handler methods
Expand Down
2 changes: 1 addition & 1 deletion example/hello_world.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"net/http"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

// curl -X GET 127.0.0.1:4242/hello
Expand Down
4 changes: 2 additions & 2 deletions example/http2_mtls/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module http_try

go 1.20
go 1.21

require (
github.com/dgrr/http2 v0.3.5
Expand All @@ -14,4 +14,4 @@ require (
github.com/valyala/fastrand v1.0.0 // indirect
)

replace github.com/burgesQ/webfmwk/v5 => /home/master/repo/webfmwk
replace github.com/burgesQ/webfmwk/v6 => ../../
4 changes: 2 additions & 2 deletions example/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"net/http"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v5/handler/logging"
"github.com/burgesQ/webfmwk/v6"
"github.com/burgesQ/webfmwk/v6/handler/logging"
)

// curl -X GET 127.0.0.1:4242/hello
Expand Down
6 changes: 3 additions & 3 deletions example/panic_to_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"crypto/rand"
"math/big"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v5/handler/logging"
"github.com/burgesQ/webfmwk/v5/handler/recover"
"github.com/burgesQ/webfmwk/v6"
"github.com/burgesQ/webfmwk/v6/handler/logging"
"github.com/burgesQ/webfmwk/v6/handler/recover"
)

func panicToError() *webfmwk.Server {
Expand Down
2 changes: 1 addition & 1 deletion example/post_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"net/http"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion example/query_param.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

// QueryParam
Expand Down
2 changes: 1 addition & 1 deletion example/routes.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions example/swagger.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v5/handler/redoc"
"github.com/burgesQ/webfmwk/v6"
"github.com/burgesQ/webfmwk/v6/handler/redoc"
)

// TODO: form & payload schema
Expand Down
2 changes: 1 addition & 1 deletion example/tls.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

// TODO: curl with HTTPS
Expand Down
2 changes: 1 addition & 1 deletion example/url_param.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"net/http"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

// curl -X GET 127.0.0.1:4242/hello/world
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/burgesQ/webfmwk/v5
module github.com/burgesQ/webfmwk/v6

go 1.19

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

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion handler/logging/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/burgesQ/gommon/webtest"
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion handler/recover/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package recover
import (
"fmt"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

// Handler launch a panic catcher - if the catched panic hold an
Expand Down
2 changes: 1 addition & 1 deletion handler/recover/recover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/burgesQ/gommon/webtest"
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion handler/redoc/redoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"text/template"

"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion handler/redoc/redoc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/burgesQ/gommon/webtest"
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion handler/security/security.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package security

import "github.com/burgesQ/webfmwk/v5"
import "github.com/burgesQ/webfmwk/v6"

const (
headerProtection = "X-Xss-Protection"
Expand Down
2 changes: 1 addition & 1 deletion handler/security/security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/burgesQ/gommon/webtest"
"github.com/burgesQ/webfmwk/v5"
"github.com/burgesQ/webfmwk/v6"
"github.com/stretchr/testify/require"
)

Expand Down
8 changes: 4 additions & 4 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ func SetPrefix(prefix string) Option {
// package main
//
// import (
// "github.com/burgesQ/webfmwk/v5"
// "github.com/burgesQ/webfmwk/v5/handler/redoc"
// "github.com/burgesQ/webfmwk/v6"
// "github.com/burgesQ/webfmwk/v6/handler/redoc"
// )
//
// func main() {
Expand All @@ -178,8 +178,8 @@ func WithDocHandlers(handler ...DocHandler) Option {
// package main
//
// import (
// "github.com/burgesQ/webfmwk/v5"
// "github.com/burgesQ/webfmwk/v5/handler/security"
// "github.com/burgesQ/webfmwk/v6"
// "github.com/burgesQ/webfmwk/v6/handler/security"
// )
//
// type CustomContext struct {
Expand Down
2 changes: 1 addition & 1 deletion poll_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

"github.com/burgesQ/webfmwk/v5/tls"
"github.com/burgesQ/webfmwk/v6/tls"
)

func getResp(ctx context.Context, uri string, cfg ...tls.IConfig) (*http.Response, error) {
Expand Down
6 changes: 3 additions & 3 deletions route.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type (
// Handler hold the function signature for webfmwk Handler chaning (middlware).
//
// import (
// github.com/burgesQ/webfmwk/v5
// github.com/burgesQ/webfmwk/v6
// github.com/burgesQ/webfmwk/handler/logging
// github.com/burgesQ/webfmwk/handler/security
// )
Expand All @@ -59,7 +59,7 @@ type (
//
// Example serving a redoc one:
// import (
// github.com/burgesQ/webfmwk/v5
// github.com/burgesQ/webfmwk/v6
// github.com/burgesQ/webfmwk/handler/redoc
// )
//
Expand Down Expand Up @@ -198,7 +198,7 @@ func (s *Server) RouteApplier(rpps ...RoutesPerPrefix) {
}

// GetRouter create a fasthttp/router.Router whit:
// - registered handlers (webfmwk/v5/handler)
// - registered handlers (webfmwk/v6/handler)
// - doc handler is registered
// - test handler (/ping) is registered
// - registered fmwk routes
Expand Down
4 changes: 2 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"syscall"

"github.com/burgesQ/log"
wlog "github.com/burgesQ/webfmwk/v5/log"
"github.com/burgesQ/webfmwk/v5/tls"
wlog "github.com/burgesQ/webfmwk/v6/log"
"github.com/burgesQ/webfmwk/v6/tls"
fasthttp2 "github.com/dgrr/http2"
"github.com/lab259/cors"
"github.com/valyala/fasthttp"
Expand Down
2 changes: 1 addition & 1 deletion tls/cmd/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package webfmwk/v5/tls/cmd hold function destined to be used for command line
// Package webfmwk/v6/tls/cmd hold function destined to be used for command line
// implementation.
// Please see the github.com/spf13/viper package, github.com/spf13/cobra or
// gitlab.frafos.net/gommon/golib/v2/cmd.
Expand Down
2 changes: 1 addition & 1 deletion tls/cmd/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"reflect"

"github.com/burgesQ/webfmwk/v5/tls"
"github.com/burgesQ/webfmwk/v6/tls"
"github.com/mitchellh/mapstructure"
)

Expand Down
2 changes: 1 addition & 1 deletion tls/cmd/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/burgesQ/webfmwk/v5/tls"
"github.com/burgesQ/webfmwk/v6/tls"
"github.com/stretchr/testify/require"
)

Expand Down
Loading

0 comments on commit 94b1e26

Please sign in to comment.