1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-02-05 13:15:11 +02:00
kratos/selector/filter.go
longxboy 988c2312b4
feat: add base fitler to improve performace (#1612)
* add node filter

Co-authored-by: chenzhihui <zhihui_chen@foxmail.com>
2021-11-08 15:22:04 +08:00

11 lines
262 B
Go

package selector
import "context"
// Filter is select filter.
type Filter func(context.Context, []Node) []Node
// NodeFilter is node filter.
// If it returns false, the node will be removed out from the balancer pick list
type NodeFilter func(node Node) bool