Documentation ¶
Index ¶
- type BalanceStrategy
- type Dispatcher
- func (d *Dispatcher) FindEndpoint(insID string) (*endpoint.Endpoint, error)
- func (d *Dispatcher) FindEvent(event int) (*Event, error)
- func (d *Dispatcher) FindRoute(route int32) (*Route, error)
- func (d *Dispatcher) IterateEndpoint(fn func(insID string, ep *endpoint.Endpoint) bool)
- func (d *Dispatcher) ReplaceServices(services ...*registry.ServiceInstance)
- type Event
- type Route
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BalanceStrategy ¶
type BalanceStrategy string
const ( Random BalanceStrategy = "random" // 随机 RoundRobin BalanceStrategy = "rr" // 轮询 WeightRoundRobin BalanceStrategy = "wrr" // 加权轮询 )
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(strategy BalanceStrategy) *Dispatcher
func (*Dispatcher) FindEndpoint ¶
func (d *Dispatcher) FindEndpoint(insID string) (*endpoint.Endpoint, error)
FindEndpoint 查找服务端口
func (*Dispatcher) FindEvent ¶
func (d *Dispatcher) FindEvent(event int) (*Event, error)
FindEvent 查找节点事件
func (*Dispatcher) FindRoute ¶
func (d *Dispatcher) FindRoute(route int32) (*Route, error)
FindRoute 查找节点路由
func (*Dispatcher) IterateEndpoint ¶
func (d *Dispatcher) IterateEndpoint(fn func(insID string, ep *endpoint.Endpoint) bool)
IterateEndpoint 迭代服务端口
func (*Dispatcher) ReplaceServices ¶
func (d *Dispatcher) ReplaceServices(services ...*registry.ServiceInstance)
ReplaceServices 替换服务
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func (*Event) FindEndpoint ¶
FindEndpoint 查询路由服务端点
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) FindEndpoint ¶
FindEndpoint 查询路由服务端点
func (*Route) IterateEndpoint ¶
IterateEndpoint 迭代服务端口
Click to show internal directories.
Click to hide internal directories.