Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ERROR = &RpcError{-1, "ERROR"} SUCCESS = &RpcError{200, "SUCCESS"} )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler func(RpcContext) interface{}
type RpcBeanInitialization ¶
type RpcBeanInitialization interface {
InitRpcBean(c RpcContainer)
}
RPC Bean 初始化
type RpcContainer ¶
type RpcContainer interface {
Stop()
Start(address string) error
StartTLS(address string, certFile, keyFile string) error
// 注册 RPC 方法(服务名+方法名)
Register(service string, method string, fn Handler)
}
RPC 服务器
type RpcContext ¶
type RpcContext interface {
SpringTrace.TraceContext
Bind(i interface{}) error
// Get retrieves data from the context.
Get(key string) interface{}
// Set saves data in the context.
Set(key string, val interface{})
}
RPC 上下文,务必保持是 WebContext 的子集!
Click to show internal directories.
Click to hide internal directories.