Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LoadedPluginTypes = []Type{ TypeServerConnector, TypeServiceRouter, TypeLoadBalancer, TypeHealthCheck, TypeCircuitBreaker, TypeWeightAdjuster, TypeStatReporter, TypeLocalRegistry, TypeRateLimiter, TypeLocationProvider, TypeConfigConnector, }
LoadedPluginTypes 要加载的插件类型
Functions ¶
This section is empty.
Types ¶
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier 通知回调器的函数
type PluginEvent ¶
type PluginEvent struct { // 事件类型 EventType PluginEventType // 事件对象 EventObject interface{} }
PluginEvent 插件事件
type PluginEventHandler ¶
type PluginEventHandler struct {
Callback func(event *PluginEvent) error
}
PluginEventHandler 触发插件事件的回调
type PluginEventType ¶
type PluginEventType int
PluginEventType .
const ( // OnInstanceLocalValueCreated 本地缓存实例创建后触发的时机 OnInstanceLocalValueCreated PluginEventType = 0x8001 // OnContextStarted 在所有插件创建完毕后触发的事件 OnContextStarted PluginEventType = 0x8002 // OnServiceAdded sdk内存中添加了一个服务(实例或路由)触发的事件 OnServiceAdded PluginEventType = 0x8003 // OnServiceUpdated sdk内存中更新了一个服务(实例或路由)触发的事件 OnServiceUpdated PluginEventType = 0x8004 // OnServiceDeleted sdk内存中删除了一个服务(实例或路由)触发的事件 OnServiceDeleted PluginEventType = 0x8005 // OnRoutedClusterReturned 一个经过路由的cluster返回给用户 OnRoutedClusterReturned PluginEventType = 0x8006 // OnServiceLocalValueCreated 一个服务的localvalue创建触发的事件 OnServiceLocalValueCreated PluginEventType = 0x8007 // OnRateLimitWindowCreated 一个限流规则的限流窗口创建时触发的事件 OnRateLimitWindowCreated PluginEventType = 0x8008 // OnRateLimitWindowDeleted 一个限流规则的限流窗口被删除时触发的事件 OnRateLimitWindowDeleted PluginEventType = 0x8009 )
type RateLimitDiffInfo ¶
type RateLimitDiffInfo struct { // 哪些规则的版本变化了,key为ruleID,value为RevisionChange UpdatedRules map[string]*RevisionChange // 哪些规则被删除了,key为ruleID,value为revision DeletedRules map[string]string }
RateLimitDiffInfo 限流规则的变化信息
type RevisionChange ¶
RevisionChange 版本号变化
type RunContext ¶
type RunContext struct {
// contains filtered or unexported fields
}
RunContext 控制插件启动销毁的运行上下文
type ServiceEventObject ¶
type ServiceEventObject struct { // 事件对象信息 SvcEventKey model.ServiceEventKey // 缓存中已有的对象,如果是新增,则为nil OldValue interface{} // 新加入缓存的对象,如果是删除,则为nil NewValue interface{} }
ServiceEventObject 服务变更对象,对于OnServiceAdded,OnServiceUpdated,OnServiceDeleted的事件,会传递该对象
type Type ¶
type Type uint32
Type 插件类型,每个扩展点有自己独立的插件类型
const ( // TypePluginBase . TypePluginBase Type = 0x1000 // TypeServerConnector 注册中心连接器扩展点 TypeServerConnector Type = 0x1001 // TypeLocalRegistry 本地缓存扩展点 TypeLocalRegistry Type = 0x1002 // TypeServiceRouter 服务路由扩展点 TypeServiceRouter Type = 0x1003 // TypeLoadBalancer 负载均衡扩展点 TypeLoadBalancer Type = 0x1004 // TypeHealthCheck 健康探测扩展点 TypeHealthCheck Type = 0x1005 // TypeCircuitBreaker 节点熔断扩展点 TypeCircuitBreaker Type = 0x1006 // TypeWeightAdjuster 动态权重调整扩展点 TypeWeightAdjuster Type = 0x1007 // TypeStatReporter 统计上报扩展点 TypeStatReporter Type = 0x1008 // TypeRateLimiter 限流扩展点 TypeRateLimiter Type = 0x1010 // TypeLocationProvider 实例地理信息获取扩展点 TypeLocationProvider Type = 0x1012 // TypeConfigConnector extend point of config file connector TypeConfigConnector Type = 0x1014 )
Click to show internal directories.
Click to hide internal directories.