update for latest micro

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-04-20 12:55:27 +03:00
parent 683eb62973
commit d0bc3d0d3b
3 changed files with 7 additions and 13 deletions

6
go.mod
View File

@ -1,14 +1,12 @@
module github.com/unistack-org/micro-server-grpc/v3 module github.com/unistack-org/micro-server-grpc/v3
go 1.15 go 1.16
require ( require (
github.com/golang/protobuf v1.5.2 github.com/golang/protobuf v1.5.2
github.com/unistack-org/micro/v3 v3.3.15 github.com/unistack-org/micro/v3 v3.3.16
golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/grpc v1.37.0 google.golang.org/grpc v1.37.0
google.golang.org/protobuf v1.26.0 google.golang.org/protobuf v1.26.0
) )
//replace github.com/unistack-org/micro/v3 => ../../micro

4
go.sum
View File

@ -42,8 +42,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
github.com/silas/dag v0.0.0-20210121180416-41cf55125c34/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I= github.com/silas/dag v0.0.0-20210121180416-41cf55125c34/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/unistack-org/micro/v3 v3.3.15 h1:rj+spzhezCg4gmj1nuF0FRGixC51/7xFACOchB/23/E= github.com/unistack-org/micro/v3 v3.3.16 h1:v0h/oC0TO2n1djQJeOjD2jNEqKkiykwI6cpflEVTlQE=
github.com/unistack-org/micro/v3 v3.3.15/go.mod h1:ETGcQQUcjxGaD44LUMX+0fgo8Loh7ExldfIPLvfUmDo= github.com/unistack-org/micro/v3 v3.3.16/go.mod h1:ETGcQQUcjxGaD44LUMX+0fgo8Loh7ExldfIPLvfUmDo=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=

10
grpc.go
View File

@ -636,11 +636,9 @@ func (g *grpcServer) Register() error {
g.RLock() g.RLock()
// Maps are ordered randomly, sort the keys for consistency // Maps are ordered randomly, sort the keys for consistency
var handlerList []string var handlerList []string
for n, e := range g.handlers { for n, _ := range g.handlers {
// Only advertise non internal handlers // Only advertise non internal handlers
if !e.Options().Internal { handlerList = append(handlerList, n)
handlerList = append(handlerList, n)
}
} }
sort.Strings(handlerList) sort.Strings(handlerList)
@ -648,9 +646,7 @@ func (g *grpcServer) Register() error {
var subscriberList []*subscriber var subscriberList []*subscriber
for e := range g.subscribers { for e := range g.subscribers {
// Only advertise non internal subscribers // Only advertise non internal subscribers
if !e.Options().Internal { subscriberList = append(subscriberList, e)
subscriberList = append(subscriberList, e)
}
} }
sort.Slice(subscriberList, func(i, j int) bool { sort.Slice(subscriberList, func(i, j int) bool {
return subscriberList[i].topic > subscriberList[j].topic return subscriberList[i].topic > subscriberList[j].topic