Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrNoneAvailable = errors.New("none available") )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
Option 根据配置选项初始化 selector
func OptRegistry ¶ added in v1.2.0
OptRegistry 设置selector的注册表对象
type Options ¶
type Options struct { // 服务注册表 Registry registry.Registry // 节点选择策略引擎 Strategy Strategy // 扩展配置,可以添加自定义选项 Context context.Context }
Options selector的配置参数
type SelectOption ¶
type SelectOption func(*SelectOptions)
SelectOption 调用select 方法的时候传入的配置
func OptWithFilter ¶ added in v1.2.0
func OptWithFilter(fn ...Filter) SelectOption
OptWithFilter 添加节点过滤规则
func OptWithStrategy ¶ added in v1.2.0
func OptWithStrategy(fn Strategy) SelectOption
OptWithStrategy 在调用select方法时候传入节点策略引擎
type SelectOptions ¶
type SelectOptions struct { // 节点过滤器列表 Filters []Filter // 节点选择策略引擎 Strategy Strategy // 扩展配置,可以添加自定义选项 Context context.Context }
SelectOptions 节点选择器参数
Click to show internal directories.
Click to hide internal directories.