dispatcher

package
v2.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher struct {
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher(dispatch cluster.Dispatch) *Dispatcher

func (*Dispatcher) Endpoints

func (d *Dispatcher) Endpoints() map[string]*endpoint.Endpoint

Endpoints 获取所有端口

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) ReplaceServices

func (d *Dispatcher) ReplaceServices(services ...*registry.ServiceInstance)

ReplaceServices 替换服务

func (*Dispatcher) VisitEndpoints

func (d *Dispatcher) VisitEndpoints(fn func(insID string, ep *endpoint.Endpoint) bool)

VisitEndpoints 迭代服务端口

type Event

type Event struct {
	// contains filtered or unexported fields
}

func (*Event) Event

func (e *Event) Event() int

Event 获取事件

func (*Event) VisitEndpoints

func (e *Event) VisitEndpoints(fn func(insID string, ep *endpoint.Endpoint) bool)

VisitEndpoints 迭代服务端口

type Route

type Route struct {
	// contains filtered or unexported fields
}

func (*Route) Authorized

func (r *Route) Authorized() bool

Authorized 是否授权路由

func (*Route) FindEndpoint

func (r *Route) FindEndpoint(insID ...string) (*endpoint.Endpoint, error)

FindEndpoint 查询路由服务端点

func (*Route) Group

func (r *Route) Group() string

Group 路由所属组

func (*Route) ID

func (r *Route) ID() int32

ID 获取路由ID

func (*Route) Internal

func (r *Route) Internal() bool

Internal 是否内部路由

func (*Route) Stateful

func (r *Route) Stateful() bool

Stateful 是否有状态路由

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL