Documentation
¶
Index ¶
- func Deregister() (err error)
- func OnInit(s base.IClusterService, opt ...Option) (err error)
- func RegisterRpcFunc(rId core.Rpc_Key, sId string) (err error)
- func Registry() (err error)
- func UnRegisterRpcFunc(rId core.Rpc_Key, sId string) (err error)
- type Consulregistry
- func (this *Consulregistry) DeregisterSNode(sId string) (err error)
- func (this *Consulregistry) GetRpcSubById(rId core.Rpc_Key) (rf *RpcFuncInfo, err error)
- func (this *Consulregistry) GetServiceByCategory(category core.S_Category) (n []*ServiceNode, err error)
- func (this *Consulregistry) GetServiceById(sId string) (n *ServiceNode, err error)
- func (this *Consulregistry) GetServiceByType(sType string) (n []*ServiceNode, err error)
- func (this *Consulregistry) Options() Options
- func (this *Consulregistry) RegisterRpcSub(rId core.Rpc_Key, sId string) (err error)
- func (this *Consulregistry) RegisterSNode(s *ServiceNode) (err error)
- func (this *Consulregistry) RpcHandler(idx uint64, data interface{})
- func (this *Consulregistry) SHandler(idx uint64, data interface{})
- func (this *Consulregistry) SNodeHandler(idx uint64, data interface{})
- func (this *Consulregistry) UnRegisterRpcSub(rId core.Rpc_Key, sId string) (err error)
- type FindServiceHandle
- type IRegistry
- type LoseServiceHandle
- type Option
- type Options
- type RpcFuncInfo
- type ServiceNode
- type ServiceRpcSub
- type UpDataServiceHandle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Consulregistry ¶
type Consulregistry struct {
// contains filtered or unexported fields
}
func (*Consulregistry) DeregisterSNode ¶
func (this *Consulregistry) DeregisterSNode(sId string) (err error)
注销服务节点
func (*Consulregistry) GetRpcSubById ¶
func (this *Consulregistry) GetRpcSubById(rId core.Rpc_Key) (rf *RpcFuncInfo, err error)
func (*Consulregistry) GetServiceByCategory ¶
func (this *Consulregistry) GetServiceByCategory(category core.S_Category) (n []*ServiceNode, err error)
func (*Consulregistry) GetServiceById ¶
func (this *Consulregistry) GetServiceById(sId string) (n *ServiceNode, err error)
func (*Consulregistry) GetServiceByType ¶
func (this *Consulregistry) GetServiceByType(sType string) (n []*ServiceNode, err error)
func (*Consulregistry) Options ¶
func (this *Consulregistry) Options() Options
func (*Consulregistry) RegisterRpcSub ¶
func (this *Consulregistry) RegisterRpcSub(rId core.Rpc_Key, sId string) (err error)
注册rpc订阅信息
func (*Consulregistry) RegisterSNode ¶
func (this *Consulregistry) RegisterSNode(s *ServiceNode) (err error)
注册服务节点
func (*Consulregistry) RpcHandler ¶
func (this *Consulregistry) RpcHandler(idx uint64, data interface{})
监控服务列表变化
func (*Consulregistry) SHandler ¶
func (this *Consulregistry) SHandler(idx uint64, data interface{})
监控服务列表变化
func (*Consulregistry) SNodeHandler ¶
func (this *Consulregistry) SNodeHandler(idx uint64, data interface{})
监控服务列表变化
func (*Consulregistry) UnRegisterRpcSub ¶
func (this *Consulregistry) UnRegisterRpcSub(rId core.Rpc_Key, sId string) (err error)
type FindServiceHandle ¶
type FindServiceHandle func(snode ServiceNode)
type IRegistry ¶
type IRegistry interface {
Options() Options
GetServiceById(sId string) (n *ServiceNode, err error)
GetServiceByType(sType string) (n []*ServiceNode, err error)
GetServiceByCategory(category core.S_Category) (n []*ServiceNode, err error)
RegisterSNode(s *ServiceNode) (err error)
DeregisterSNode(sId string) (err error)
RegisterRpcSub(rId core.Rpc_Key, sId string) (err error)
UnRegisterRpcSub(rId core.Rpc_Key, sId string) (err error)
GetRpcSubById(rId core.Rpc_Key) (rf *RpcFuncInfo, err error)
}
type LoseServiceHandle ¶
type LoseServiceHandle func(sId string)
type Option ¶
type Option func(*Options)
func FindHandle ¶
func FindHandle(v FindServiceHandle) Option
func LoseHandle ¶
func LoseHandle(v LoseServiceHandle) Option
func RegisterInterval ¶
func RegisterTTL ¶
func UpDataHandle ¶
func UpDataHandle(v UpDataServiceHandle) Option
type Options ¶
type Options struct {
Address string
Timeout time.Duration
RegisterInterval time.Duration
RegisterTTL time.Duration
Find FindServiceHandle
UpData UpDataServiceHandle
Lose LoseServiceHandle
Tag string //集群标签
}
type RpcFuncInfo ¶
type RpcFuncInfo struct {
Id string //Rpc 方法Id
SubServiceIds map[string]*ServiceRpcSub //订阅数据
}
func GetRpcFunc ¶
func GetRpcFunc(rId core.Rpc_Key) (data *RpcFuncInfo, err error)
type ServiceNode ¶
type ServiceNode struct {
Tag string `json:"Tag"`
Type string `json:"Type"`
Category core.S_Category `json:"Category"`
Id string `json:"Id"`
Version int32 `json:"Version"`
RpcId string `json:"RpcId"`
PreWeight int32 `json:"PreWeight"`
}
func GetServiceByCategory ¶
func GetServiceByCategory(category core.S_Category) (nodes []*ServiceNode, err error)
func GetServiceById ¶
func GetServiceById(sId string) (node *ServiceNode, err error)
func GetServiceByType ¶
func GetServiceByType(sId string) (nodes []*ServiceNode, err error)
type ServiceRpcSub ¶
type UpDataServiceHandle ¶
type UpDataServiceHandle func(snode ServiceNode)
Click to show internal directories.
Click to hide internal directories.