Documentation ¶
Index ¶
- type ConnConfig
- type ConnConfigOption
- type RpcClient
- type RpcClientConn
- func (rcc *RpcClientConn) Accept(ctx network.Context)
- func (rcc *RpcClientConn) ClientID() *network.ClientID
- func (rcc *RpcClientConn) Closed(ctx network.Context)
- func (rcc *RpcClientConn) Destory()
- func (rcc *RpcClientConn) Ping(ctx network.Context)
- func (rcc *RpcClientConn) Recvice(ctx network.Context)
- func (rcc *RpcClientConn) Register(key interface{}, f func(*RpcClientContext) (protoreflect.ProtoMessage, error))
- type RpcClientContext
- type RpcPool
- type RpcServer
- func (s *RpcServer) GetClient(cid *network.ClientID) RpcClient
- func (s *RpcServer) Open(addr string) error
- func (s *RpcServer) Register(cid *network.ClientID, rc RpcClient)
- func (s *RpcServer) ReleaseClient(client RpcClient)
- func (s *RpcServer) Shutdown()
- func (s *RpcServer) UnRegister(cid *network.ClientID)
- func (s *RpcServer) WithPool(pool RpcPool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnConfig ¶
func Configure ¶
func Configure(options ...ConnConfigOption) *ConnConfig
type ConnConfigOption ¶
type ConnConfigOption func(config *ConnConfig)
ConnConfigOption 是一个配置rpc connector 的函数
func WithPool ¶
func WithPool(f RpcPool) ConnConfigOption
type RpcClient ¶
type RpcClient interface { ClientID() *network.ClientID Register(key interface{}, f func(*RpcClientContext) (protoreflect.ProtoMessage, error)) Accept(ctx network.Context) Ping(ctx network.Context) Recvice(ctx network.Context) Closed(ctx network.Context) Destory() // contains filtered or unexported methods }
func NewRpcClientConn ¶
type RpcClientConn ¶
type RpcClientConn struct {
// contains filtered or unexported fields
}
func (*RpcClientConn) Accept ¶
func (rcc *RpcClientConn) Accept(ctx network.Context)
func (*RpcClientConn) ClientID ¶
func (rcc *RpcClientConn) ClientID() *network.ClientID
func (*RpcClientConn) Closed ¶
func (rcc *RpcClientConn) Closed(ctx network.Context)
func (*RpcClientConn) Destory ¶
func (rcc *RpcClientConn) Destory()
func (*RpcClientConn) Ping ¶
func (rcc *RpcClientConn) Ping(ctx network.Context)
func (*RpcClientConn) Recvice ¶
func (rcc *RpcClientConn) Recvice(ctx network.Context)
func (*RpcClientConn) Register ¶
func (rcc *RpcClientConn) Register(key interface{}, f func(*RpcClientContext) (protoreflect.ProtoMessage, error))
type RpcClientContext ¶
type RpcClientContext struct {
// contains filtered or unexported fields
}
func (*RpcClientContext) Background ¶
func (rcc *RpcClientContext) Background() context.Context
func (*RpcClientContext) Context ¶
func (rcc *RpcClientContext) Context() network.Context
func (*RpcClientContext) Message ¶
func (rcc *RpcClientContext) Message() interface{}
func (*RpcClientContext) SequenceID ¶
func (rcc *RpcClientContext) SequenceID() int32
type RpcPool ¶
func NewDefaultRpcPool ¶
type RpcServer ¶
type RpcServer struct { *network.NetworkSystem // contains filtered or unexported fields }
func New ¶
func New(options ...ConnConfigOption) *RpcServer
func (*RpcServer) ReleaseClient ¶
func (*RpcServer) UnRegister ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.