Documentation ¶
Overview ¶
mRPC = mDNS + RPC.
Index ¶
- Constants
- type AsyncCallResult
- type RPC
- func (r *RPC) AsyncCall(instanceName string, serviceMethod string, args interface{}) error
- func (r *RPC) Call(service string, method string, args interface{}, reply interface{}) error
- func (r *RPC) Close() error
- func (r *RPC) RegisterService(serviceName string, rcvrs ...interface{}) error
- func (r *RPC) UnRegisterService(service string)
- type ServiceEvent
Constants ¶
View Source
const ( ServiceActionOnline = iota ServiceActionOffline )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncCallResult ¶
type RPC ¶
type RPC struct { // client AsyncCallResultChan chan *AsyncCallResult // 通知异步调用结果 ServiceEventChan chan *ServiceEvent // 通知service上线或下线 // contains filtered or unexported fields }
RPC RPC结构
func (*RPC) RegisterService ¶
RegisterService 注册服务实例和receiver 其中rcvr实现了handler; 具体用什么ip、port,随机选取,对用户透明。需要rpc中维护连接池。
func (*RPC) UnRegisterService ¶
type ServiceEvent ¶
Click to show internal directories.
Click to hide internal directories.