update micro to v3.1.1
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
58f8ed2f73
commit
3dc53c0117
4
go.mod
4
go.mod
@ -1,5 +1,5 @@
|
||||
module github.com/unistack-org/micro-api-router-static
|
||||
module github.com/unistack-org/micro-api-router-static/v3
|
||||
|
||||
go 1.15
|
||||
|
||||
require github.com/unistack-org/micro/v3 v3.0.2-0.20210109225421-8930c3fbb748
|
||||
require github.com/unistack-org/micro/v3 v3.1.1
|
||||
|
6
go.sum
6
go.sum
@ -219,10 +219,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
|
||||
github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY=
|
||||
github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4o2HM0m3DZYQWsj6/MEowD57VzoH0v3d7igeFY=
|
||||
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
|
||||
github.com/unistack-org/micro/v3 v3.0.2-0.20201220205329-e6f870bda71a h1:S3KGfUO9LttJMvakfFZgd1bLz8XY2Z7X0DYLdgDDhXY=
|
||||
github.com/unistack-org/micro/v3 v3.0.2-0.20201220205329-e6f870bda71a/go.mod h1:0DgOy4OdJxQCDER8YSKitZugd2+1bddrRSNfeooTHDc=
|
||||
github.com/unistack-org/micro/v3 v3.0.2-0.20210109225421-8930c3fbb748 h1:tPXIO1QFi2DxPv8nsSACNKsydmToqHZ4x0xIZMvX9es=
|
||||
github.com/unistack-org/micro/v3 v3.0.2-0.20210109225421-8930c3fbb748/go.mod h1:0DgOy4OdJxQCDER8YSKitZugd2+1bddrRSNfeooTHDc=
|
||||
github.com/unistack-org/micro/v3 v3.1.1 h1:kWL0BVzUBdotjfDbl1qL9lNYmZqvebQWPNCyqrjUSAk=
|
||||
github.com/unistack-org/micro/v3 v3.1.1/go.mod h1:0DgOy4OdJxQCDER8YSKitZugd2+1bddrRSNfeooTHDc=
|
||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||
|
10
static.go
10
static.go
@ -250,7 +250,7 @@ func (r *staticRouter) endpoint(req *http.Request) (*endpoint, error) {
|
||||
continue
|
||||
}
|
||||
if logger.V(logger.TraceLevel) {
|
||||
logger.Tracef("api method match %s", req.Method)
|
||||
logger.Tracef(r.opts.Context, "api method match %s", req.Method)
|
||||
}
|
||||
|
||||
// 2. try host
|
||||
@ -273,7 +273,7 @@ func (r *staticRouter) endpoint(req *http.Request) (*endpoint, error) {
|
||||
continue
|
||||
}
|
||||
if logger.V(logger.TraceLevel) {
|
||||
logger.Tracef("api host match %s", req.URL.Host)
|
||||
logger.Tracef(r.opts.Context, "api host match %s", req.URL.Host)
|
||||
}
|
||||
|
||||
// 3. try google.api path
|
||||
@ -281,12 +281,12 @@ func (r *staticRouter) endpoint(req *http.Request) (*endpoint, error) {
|
||||
matches, err := pathreg.Match(path, "")
|
||||
if err != nil {
|
||||
if logger.V(logger.TraceLevel) {
|
||||
logger.Tracef("api gpath not match %s != %v", path, pathreg)
|
||||
logger.Tracef(r.opts.Context, "api gpath not match %s != %v", path, pathreg)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if logger.V(logger.TraceLevel) {
|
||||
logger.Tracef("api gpath match %s = %v", path, pathreg)
|
||||
logger.Tracef(r.opts.Context, "api gpath match %s = %v", path, pathreg)
|
||||
}
|
||||
pMatch = true
|
||||
ctx := req.Context()
|
||||
@ -307,7 +307,7 @@ func (r *staticRouter) endpoint(req *http.Request) (*endpoint, error) {
|
||||
for _, pathreg := range ep.pcreregs {
|
||||
if !pathreg.MatchString(req.URL.Path) {
|
||||
if logger.V(logger.TraceLevel) {
|
||||
logger.Tracef("api pcre path not match %s != %v", req.URL.Path, pathreg)
|
||||
logger.Tracef(r.opts.Context, "api pcre path not match %s != %v", req.URL.Path, pathreg)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user