diff --git a/contrib/registry/servicecomb/watcher.go b/contrib/registry/servicecomb/watcher.go index b1f4fccfa..cc4545ccc 100644 --- a/contrib/registry/servicecomb/watcher.go +++ b/contrib/registry/servicecomb/watcher.go @@ -1,8 +1,9 @@ package servicecomb import ( + "context" + "github.com/go-chassis/sc-client" - "golang.org/x/net/context" "github.com/go-kratos/kratos/v2/registry" ) diff --git a/selector/p2c/p2c.go b/selector/p2c/p2c.go index 1d0ef8c56..afca98079 100644 --- a/selector/p2c/p2c.go +++ b/selector/p2c/p2c.go @@ -13,16 +13,16 @@ import ( const ( forcePick = time.Second * 3 - // Name is balancer name + // Name is p2c(Pick of 2 choices) balancer name Name = "p2c" ) var _ selector.Balancer = (*Balancer)(nil) -// Option is random builder option. +// Option is p2c builder option. type Option func(o *options) -// options is random builder options +// options is p2c builder options type options struct{} // New creates a p2c selector. diff --git a/selector/wrr/wrr.go b/selector/wrr/wrr.go index 3d91d62e3..f81d71714 100644 --- a/selector/wrr/wrr.go +++ b/selector/wrr/wrr.go @@ -9,19 +9,19 @@ import ( ) const ( - // Name is wrr balancer name + // Name is wrr(Weighted Round Robin) balancer name Name = "wrr" ) var _ selector.Balancer = (*Balancer)(nil) // Name is balancer name -// Option is random builder option. +// Option is wrr builder option. type Option func(o *options) -// options is random builder options +// options is wrr builder options type options struct{} -// Balancer is a random balancer. +// Balancer is a wrr balancer. type Balancer struct { mu sync.Mutex currentWeight map[string]float64