Documentation ¶
Index ¶
- Variables
- type IProcedure
- type Procedure
- type RPCli
- func (c *RPCli) AddProcedure(id uid.Id, proc any) error
- func (c *RPCli) GetProcedure(id uid.Id) (IProcedure, bool)
- func (c *RPCli) OneWayRPC(service, comp, method string, args ...any) error
- func (c *RPCli) OneWayRPCToEntity(entityId uid.Id, service, comp, method string, args ...any) error
- func (c *RPCli) RPC(service, comp, method string, args ...any) runtime.AsyncRet
- func (c *RPCli) RPCToEntity(entityId uid.Id, service, comp, method string, args ...any) runtime.AsyncRet
- func (c *RPCli) RemoveProcedure(id uid.Id) error
- type RPCliCreator
- func (ctor RPCliCreator) AuthExtensions(extensions []byte) RPCliCreator
- func (ctor RPCliCreator) AuthToken(token string) RPCliCreator
- func (ctor RPCliCreator) AuthUserId(userId string) RPCliCreator
- func (ctor RPCliCreator) Connect(ctx context.Context, endpoint string) (*RPCli, error)
- func (ctor RPCliCreator) FutureTimeout(d time.Duration) RPCliCreator
- func (ctor RPCliCreator) GAPDecoderMsgCreator(mc gap.IMsgCreator) RPCliCreator
- func (ctor RPCliCreator) GTPAutoReconnect(b bool) RPCliCreator
- func (ctor RPCliCreator) GTPAutoReconnectInterval(dur time.Duration) RPCliCreator
- func (ctor RPCliCreator) GTPAutoReconnectRetryTimes(times int) RPCliCreator
- func (ctor RPCliCreator) GTPCompressedSize(size int) RPCliCreator
- func (ctor RPCliCreator) GTPCompression(c gtp.Compression) RPCliCreator
- func (ctor RPCliCreator) GTPDecoderMsgCreator(mc gtp.IMsgCreator) RPCliCreator
- func (ctor RPCliCreator) GTPEncCipherSuite(cs gtp.CipherSuite) RPCliCreator
- func (ctor RPCliCreator) GTPEncSignatureAlgorithm(sa gtp.SignatureAlgorithm) RPCliCreator
- func (ctor RPCliCreator) GTPEncSignaturePrivateKey(priv crypto.PrivateKey) RPCliCreator
- func (ctor RPCliCreator) GTPEncVerifyServerSignature(b bool) RPCliCreator
- func (ctor RPCliCreator) GTPEncVerifySignaturePublicKey(pub crypto.PublicKey) RPCliCreator
- func (ctor RPCliCreator) GTPInactiveTimeout(d time.Duration) RPCliCreator
- func (ctor RPCliCreator) GTPRecvDataChanSize(size int, recyclable bool) RPCliCreator
- func (ctor RPCliCreator) GTPRecvDataHandler(handler cli.RecvDataHandler) RPCliCreator
- func (ctor RPCliCreator) GTPRecvEventChanSize(size int) RPCliCreator
- func (ctor RPCliCreator) GTPRecvEventHandler(handler cli.RecvEventHandler) RPCliCreator
- func (ctor RPCliCreator) GTPSendDataChanSize(size int) RPCliCreator
- func (ctor RPCliCreator) GTPSendEventChanSize(size int) RPCliCreator
- func (ctor RPCliCreator) IOBufferCap(cap int) RPCliCreator
- func (ctor RPCliCreator) IORetryTimes(times int) RPCliCreator
- func (ctor RPCliCreator) IOTimeout(d time.Duration) RPCliCreator
- func (ctor RPCliCreator) MainProcedure(proc any) RPCliCreator
- func (ctor RPCliCreator) NetProtocol(p cli.NetProtocol) RPCliCreator
- func (ctor RPCliCreator) TCPLinger(sec int) RPCliCreator
- func (ctor RPCliCreator) TCPNoDelay(b bool) RPCliCreator
- func (ctor RPCliCreator) TCPQuickAck(b bool) RPCliCreator
- func (ctor RPCliCreator) TCPRecvBuf(size int) RPCliCreator
- func (ctor RPCliCreator) TCPSendBuf(size int) RPCliCreator
- func (ctor RPCliCreator) TLSConfig(tlsConfig tls.Config) RPCliCreator
- func (ctor RPCliCreator) WebSocketOrigin(origin string) RPCliCreator
- func (ctor RPCliCreator) ZapLogger(logger *zap.Logger) RPCliCreator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEntityNotFound = errors.New("rpc: entity not found") // 找不到实体 ErrMethodNotFound = errors.New("rpc: method not found") // 找不到方法 ErrMethodParameterCountMismatch = errors.New("rpc: method parameter count mismatch") // 方法参数数量不匹配 ErrMethodParameterTypeMismatch = errors.New("rpc: method parameter type mismatch") // 方法参数类型不匹配 )
View Source
var (
Main = uid.Nil // 主过程
)
Functions ¶
This section is empty.
Types ¶
type IProcedure ¶ added in v0.1.37
type IProcedure interface { // GetCli 获取RPC客户端 GetCli() *RPCli // GetId 获取实体Id GetId() uid.Id // GetReflected 获取反射值 GetReflected() reflect.Value // RPC RPC调用 RPC(service, comp, method string, args ...any) runtime.AsyncRet // OneWayRPC 单向RPC调用 OneWayRPC(service, comp, method string, args ...any) error // contains filtered or unexported methods }
IProcedure 过程接口
type Procedure ¶ added in v0.1.37
type Procedure struct {
// contains filtered or unexported fields
}
Procedure 过程
func (*Procedure) GetReflected ¶ added in v0.1.37
GetReflected 获取反射值
type RPCli ¶
RPCli RCP客户端
func (*RPCli) AddProcedure ¶ added in v0.1.37
AddProcedure 添加过程
func (*RPCli) GetProcedure ¶ added in v0.1.37
func (c *RPCli) GetProcedure(id uid.Id) (IProcedure, bool)
GetProcedure 查询过程
func (*RPCli) OneWayRPCToEntity ¶
OneWayRPCToEntity 实体单向RPC调用
type RPCliCreator ¶
type RPCliCreator struct {
// contains filtered or unexported fields
}
RPCliCreator RPC客户端构建器
func (RPCliCreator) AuthExtensions ¶
func (ctor RPCliCreator) AuthExtensions(extensions []byte) RPCliCreator
func (RPCliCreator) AuthToken ¶
func (ctor RPCliCreator) AuthToken(token string) RPCliCreator
func (RPCliCreator) AuthUserId ¶
func (ctor RPCliCreator) AuthUserId(userId string) RPCliCreator
func (RPCliCreator) FutureTimeout ¶
func (ctor RPCliCreator) FutureTimeout(d time.Duration) RPCliCreator
func (RPCliCreator) GAPDecoderMsgCreator ¶
func (ctor RPCliCreator) GAPDecoderMsgCreator(mc gap.IMsgCreator) RPCliCreator
func (RPCliCreator) GTPAutoReconnect ¶
func (ctor RPCliCreator) GTPAutoReconnect(b bool) RPCliCreator
func (RPCliCreator) GTPAutoReconnectInterval ¶
func (ctor RPCliCreator) GTPAutoReconnectInterval(dur time.Duration) RPCliCreator
func (RPCliCreator) GTPAutoReconnectRetryTimes ¶
func (ctor RPCliCreator) GTPAutoReconnectRetryTimes(times int) RPCliCreator
func (RPCliCreator) GTPCompressedSize ¶
func (ctor RPCliCreator) GTPCompressedSize(size int) RPCliCreator
func (RPCliCreator) GTPCompression ¶
func (ctor RPCliCreator) GTPCompression(c gtp.Compression) RPCliCreator
func (RPCliCreator) GTPDecoderMsgCreator ¶
func (ctor RPCliCreator) GTPDecoderMsgCreator(mc gtp.IMsgCreator) RPCliCreator
func (RPCliCreator) GTPEncCipherSuite ¶
func (ctor RPCliCreator) GTPEncCipherSuite(cs gtp.CipherSuite) RPCliCreator
func (RPCliCreator) GTPEncSignatureAlgorithm ¶
func (ctor RPCliCreator) GTPEncSignatureAlgorithm(sa gtp.SignatureAlgorithm) RPCliCreator
func (RPCliCreator) GTPEncSignaturePrivateKey ¶
func (ctor RPCliCreator) GTPEncSignaturePrivateKey(priv crypto.PrivateKey) RPCliCreator
func (RPCliCreator) GTPEncVerifyServerSignature ¶
func (ctor RPCliCreator) GTPEncVerifyServerSignature(b bool) RPCliCreator
func (RPCliCreator) GTPEncVerifySignaturePublicKey ¶
func (ctor RPCliCreator) GTPEncVerifySignaturePublicKey(pub crypto.PublicKey) RPCliCreator
func (RPCliCreator) GTPInactiveTimeout ¶
func (ctor RPCliCreator) GTPInactiveTimeout(d time.Duration) RPCliCreator
func (RPCliCreator) GTPRecvDataChanSize ¶
func (ctor RPCliCreator) GTPRecvDataChanSize(size int, recyclable bool) RPCliCreator
func (RPCliCreator) GTPRecvDataHandler ¶
func (ctor RPCliCreator) GTPRecvDataHandler(handler cli.RecvDataHandler) RPCliCreator
func (RPCliCreator) GTPRecvEventChanSize ¶
func (ctor RPCliCreator) GTPRecvEventChanSize(size int) RPCliCreator
func (RPCliCreator) GTPRecvEventHandler ¶
func (ctor RPCliCreator) GTPRecvEventHandler(handler cli.RecvEventHandler) RPCliCreator
func (RPCliCreator) GTPSendDataChanSize ¶
func (ctor RPCliCreator) GTPSendDataChanSize(size int) RPCliCreator
func (RPCliCreator) GTPSendEventChanSize ¶
func (ctor RPCliCreator) GTPSendEventChanSize(size int) RPCliCreator
func (RPCliCreator) IOBufferCap ¶
func (ctor RPCliCreator) IOBufferCap(cap int) RPCliCreator
func (RPCliCreator) IORetryTimes ¶
func (ctor RPCliCreator) IORetryTimes(times int) RPCliCreator
func (RPCliCreator) IOTimeout ¶
func (ctor RPCliCreator) IOTimeout(d time.Duration) RPCliCreator
func (RPCliCreator) MainProcedure ¶ added in v0.1.37
func (ctor RPCliCreator) MainProcedure(proc any) RPCliCreator
func (RPCliCreator) NetProtocol ¶ added in v0.1.40
func (ctor RPCliCreator) NetProtocol(p cli.NetProtocol) RPCliCreator
func (RPCliCreator) TCPLinger ¶
func (ctor RPCliCreator) TCPLinger(sec int) RPCliCreator
func (RPCliCreator) TCPNoDelay ¶
func (ctor RPCliCreator) TCPNoDelay(b bool) RPCliCreator
func (RPCliCreator) TCPQuickAck ¶
func (ctor RPCliCreator) TCPQuickAck(b bool) RPCliCreator
func (RPCliCreator) TCPRecvBuf ¶
func (ctor RPCliCreator) TCPRecvBuf(size int) RPCliCreator
func (RPCliCreator) TCPSendBuf ¶
func (ctor RPCliCreator) TCPSendBuf(size int) RPCliCreator
func (RPCliCreator) TLSConfig ¶
func (ctor RPCliCreator) TLSConfig(tlsConfig tls.Config) RPCliCreator
func (RPCliCreator) WebSocketOrigin ¶ added in v0.1.40
func (ctor RPCliCreator) WebSocketOrigin(origin string) RPCliCreator
func (RPCliCreator) ZapLogger ¶
func (ctor RPCliCreator) ZapLogger(logger *zap.Logger) RPCliCreator
Click to show internal directories.
Click to hide internal directories.