Upgrade chi to v5 #1

Merged
lunny merged 4 commits from lunny/chi_v5 into master 2021-10-13 06:54:31 +00:00
6 changed files with 25 additions and 18 deletions

View File

@ -1,24 +1,33 @@
---
kind: pipeline
name: go1-1-1
name: go1-13
platform:
os: linux
arch: arm64
steps:
- name: test
image: golang:1.11
image: golang:1.13
environment:
GOPROXY: https://goproxy.cn
GOPROXY: https://goproxy.cn
commands:
- go build -v
- go test -v -race -coverprofile=coverage.txt -covermode=atomic
---
kind: pipeline
name: go1-1-2
name: go1-16
platform:
os: linux
arch: arm64
steps:
- name: test
image: golang:1.12
image: golang:1.16
environment:
GOPROXY: https://goproxy.cn
GOPROXY: https://goproxy.cn
commands:
- go build -v
- go test -v -race -coverprofile=coverage.txt -covermode=atomic

View File

@ -1,15 +1,14 @@
# captcha [![Build Status](https://drone.gitea.com/api/badges/macaron/captcha/status.svg)](https://drone.gitea.com/macaron/captcha)
# captcha [![Build Status](https://drone.gitea.com/api/badges/go-chi/captcha/status.svg)](https://drone.gitea.com/go-chi/captcha)
Middleware captcha provides captcha service for [Macaron](https://gitea.com/macaron/macaron).
Middleware captcha provides captcha service for [chi](https://github.com/go-chi/chi).
### Installation
go get gitea.com/macaron/captcha
go get gitea.com/go-chi/captcha
## Getting Help
- [API Reference](https://gowalker.org/gitea.com/macaron/captcha)
- [Documentation](http://go-macaron.com/docs/middlewares/captcha)
- [API Reference](https://pkg.go.dev/gitea.com/go-chi/captcha)
## License

View File

@ -13,7 +13,7 @@
// License for the specific language governing permissions and limitations
// under the License.
// Package captcha a middleware that provides captcha service for Macaron.
// Package captcha a middleware that provides captcha service for chi.
package captcha
import (
@ -202,7 +202,7 @@ func NewCaptcha(opts ...Options) *Captcha {
}
}
// Captchaer is a middleware that maps a captcha.Captcha service into the Macaron handler chain.
// Captchaer is a middleware that maps a captcha.Captcha service into the chi handler chain.
// An single variadic captcha.Options struct can be optionally provided to configure.
// This should be register after cache.Cacher.
func Captchaer(cpt *Captcha) func(http.Handler) http.Handler {

View File

@ -20,7 +20,7 @@ import (
"testing"
"gitea.com/go-chi/cache"
"github.com/go-chi/chi"
chi "github.com/go-chi/chi/v5"
. "github.com/smartystreets/goconvey/convey"
)

2
go.mod
View File

@ -4,7 +4,7 @@ go 1.11
require (
gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e
github.com/go-chi/chi v1.5.1
github.com/go-chi/chi/v5 v5.0.4
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337
github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e
)

5
go.sum
View File

@ -6,8 +6,8 @@ github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGii
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-chi/chi v1.5.1 h1:kfTK3Cxd/dkMu/rKs5ZceWYp+t5CtiE7vmaTv3LjC6w=
github.com/go-chi/chi v1.5.1/go.mod h1:REp24E+25iKvxgeTfHmdUoL5x15kBiDBlnIl5bCwe2k=
github.com/go-chi/chi/v5 v5.0.4 h1:5e494iHzsYBiyXQAHHuI4tyJS9M3V84OuX3ufIIGHFo=
github.com/go-chi/chi/v5 v5.0.4/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@ -66,7 +66,6 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/ini.v1 v1.44.2 h1:N6kNUPqiIyxP+s/aINPzRvNpcTVV30qLC0t6ZjZFlUU=
gopkg.in/ini.v1 v1.44.2/go.mod h1:M3Cogqpuv0QCi3ExAY5V4uOt4qb/R3xZubo9m8lK5wg=
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=