You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
417 B
19 lines
417 B
4 years ago
|
package balancer
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/go-kratos/kratos/v2/registry"
|
||
|
)
|
||
|
|
||
|
// DoneInfo is callback when rpc done
|
||
|
type DoneInfo struct {
|
||
|
Err error
|
||
|
Trailer map[string]string
|
||
|
}
|
||
|
|
||
|
// Balancer is node pick balancer
|
||
|
type Balancer interface {
|
||
4 years ago
|
Pick(ctx context.Context, pathPattern string, nodes []*registry.ServiceInstance) (node *registry.ServiceInstance, done func(context.Context, DoneInfo), err error)
|
||
4 years ago
|
}
|