Documentation ¶
Index ¶
- func AddProxy(proxy proxy.Proxy) error
- func AddProxyCreator(uuid uint64, pc proxy.ProxyCreator) error
- func AddStubCreator(uuid uint64, bc stub.StubCreator) error
- func Call(proxyId proxy.ProxyId, methodId, timeout uint32, retry int32, ...) (resp *protocol.ResponsePackage, err error)
- func GetProxyFromPeer(sCall *stub.StubCall) proxy.Proxy
- func GetProxyManager() *proxy.ProxyManager
- func GetStubManager() *stub.StubManager
- func Init() error
- func OnMessage(trans transport.Transport, ctx context.Context)
- func RegisterService(service IService) error
- func SetRpcLogger(logger rlog.RpcLogger)
- func Start()
- func Tick()
- type IService
- type ServiceCreator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProxyCreator ¶ added in v0.3.1
func AddProxyCreator(uuid uint64, pc proxy.ProxyCreator) error
func AddStubCreator ¶ added in v0.3.1
func AddStubCreator(uuid uint64, bc stub.StubCreator) error
func Call ¶
func Call(proxyId proxy.ProxyId, methodId, timeout uint32, retry int32, message proto.Message) (resp *protocol.ResponsePackage, err error)
Call service proxy call remote sync
func GetProxyManager ¶ added in v0.3.0
func GetProxyManager() *proxy.ProxyManager
func GetStubManager ¶ added in v0.3.0
func GetStubManager() *stub.StubManager
func Init ¶ added in v0.3.1
func Init() error
Init you can do some init operator in this function TODO add rpc init config
func RegisterService ¶
RegisterService register user impl service struct to framework
func SetRpcLogger ¶ added in v0.3.1
SetRpcLogger replace rpc framework logger
Types ¶
type IService ¶ added in v0.3.1
type IService interface { // GetUUID service uuid, generated by rpc-repo GetUUID() uint64 // OnAfterFork init service by framework, user can init some custom data in this function OnAfterFork() bool // OnTick tick your service the same goroutine OnTick() bool // OnBeforeDestroy before service unload, you can clean your own data in this func OnBeforeDestroy() bool }
IService user custom service framework interface
type ServiceCreator ¶ added in v0.3.1
type ServiceCreator func(interface{}) IService
ServiceCreator service creator
Click to show internal directories.
Click to hide internal directories.