fix: modify interface check way on selector (#2399)

pull/2406/head
180909 2 years ago committed by GitHub
parent add67beeb3
commit 2170a12aa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      selector/default_node.go
  2. 5
      selector/default_selector.go
  3. 4
      selector/node/direct/direct.go
  4. 4
      selector/node/ewma/node.go

@ -6,6 +6,8 @@ import (
"github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/registry"
) )
var _ Node = (*DefaultNode)(nil)
// DefaultNode is selector node // DefaultNode is selector node
type DefaultNode struct { type DefaultNode struct {
scheme string scheme string

@ -5,6 +5,11 @@ import (
"sync/atomic" "sync/atomic"
) )
var (
_ Rebalancer = (*Default)(nil)
_ Builder = (*DefaultBuilder)(nil)
)
// Default is composite selector. // Default is composite selector.
type Default struct { type Default struct {
NodeBuilder WeightedNodeBuilder NodeBuilder WeightedNodeBuilder

@ -13,8 +13,8 @@ const (
) )
var ( var (
_ selector.WeightedNode = &Node{} _ selector.WeightedNode = (*Node)(nil)
_ selector.WeightedNodeBuilder = &Builder{} _ selector.WeightedNodeBuilder = (*Builder)(nil)
) )
// Node is endpoint instance // Node is endpoint instance

@ -21,8 +21,8 @@ const (
) )
var ( var (
_ selector.WeightedNode = &Node{} _ selector.WeightedNode = (*Node)(nil)
_ selector.WeightedNodeBuilder = &Builder{} _ selector.WeightedNodeBuilder = (*Builder)(nil)
) )
// Node is endpoint instance // Node is endpoint instance

Loading…
Cancel
Save