update gomod and readme

pull/3/head
lintanghui 6 years ago
parent 7d6f233259
commit fb04565dca
  1. 2
      README.md
  2. 1
      go.mod
  3. 2
      go.sum
  4. 6
      pkg/naming/discovery/discovery.go
  5. 2
      pkg/net/netutil/breaker/breaker.go

@ -11,7 +11,7 @@ Kratos是[bilibili](https://www.bilibili.com)开源的一套Go微服务框架,
- [ ] config @志辉
- [ ] bm @佳辉
- [ ] warden @龙虾
- [ ] naming discovery @堂辉
- [x] naming discovery @堂辉
- [ ] cache&database @小旭
- [ ] kratos tool @普余

@ -3,6 +3,7 @@ module github.com/bilibili/Kratos
require (
github.com/go-playground/locales v0.12.1 // indirect
github.com/go-playground/universal-translator v0.16.0 // indirect
github.com/gogo/protobuf v1.2.0
github.com/golang/protobuf v1.2.0
github.com/leodido/go-urn v1.1.0 // indirect
github.com/pkg/errors v0.8.1

@ -8,6 +8,8 @@ github.com/go-playground/locales v0.12.1 h1:2FITxuFt/xuCNP1Acdhv62OzaCiviiE4kotf
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
github.com/go-playground/universal-translator v0.16.0 h1:X++omBR/4cE2MNg91AoC3rmGrCjJ8eAeUP/K/EKx4DM=
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=

@ -196,7 +196,7 @@ func (d *Discovery) selfproc(resolver naming.Resolver, event <-chan struct{}) {
}
}
func (d *Discovery) newSelf(instances naming.InstancesInfo) {
func (d *Discovery) newSelf(instances *naming.InstancesInfo) {
ins, ok := instances.Instances[d.conf.Zone]
if !ok {
return
@ -284,12 +284,12 @@ func (r *Resolver) Watch() <-chan struct{} {
}
// Fetch fetch resolver instance.
func (r *Resolver) Fetch(c context.Context) (ins naming.InstancesInfo, ok bool) {
func (r *Resolver) Fetch(c context.Context) (ins *naming.InstancesInfo, ok bool) {
r.d.mutex.RLock()
app, ok := r.d.apps[r.id]
r.d.mutex.RUnlock()
if ok {
ins, ok = app.zoneIns.Load().(naming.InstancesInfo)
ins, ok = app.zoneIns.Load().(*naming.InstancesInfo)
return
}
return

@ -4,7 +4,7 @@ import (
"sync"
"time"
xtime "go-common/library/time"
xtime "github.com/bilibili/Kratos/pkg/time"
)
// Config broker config.

Loading…
Cancel
Save