Documentation ¶
Index ¶
- Constants
- Variables
- type IProcedure
- type Procedure
- type RPCli
- func (c *RPCli) AddProcedure(name string, proc any) error
- func (c *RPCli) GetProcedure(name string) (IProcedure, bool)
- func (c *RPCli) GetRemoteTime() cli.ResponseTime
- func (c *RPCli) OnewayRPC(service, comp, method string, args ...any) error
- func (c *RPCli) RPC(service, comp, method string, args ...any) async.AsyncRet
- func (c *RPCli) RemoveProcedure(name string) 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) GTPRTTSampling(n int) 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) ReduceCP(b bool) 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 ¶
View Source
const (
Main = "" // 主过程名称
)
Variables ¶
View Source
var ( ErrProcedureExists = errors.New("rpc: procedure exists") // 过程已存在 ErrProcedureNotFound = errors.New("rpc: procedure 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") // 方法参数类型不匹配 )
Functions ¶
This section is empty.
Types ¶
type IProcedure ¶ added in v0.1.37
type IProcedure interface { // GetCli 获取RPC客户端 GetCli() *RPCli // GetName 获取名称 GetName() string // GetReflected 获取反射值 GetReflected() reflect.Value // 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(name string) (IProcedure, bool)
GetProcedure 查询过程
func (*RPCli) GetRemoteTime ¶ added in v0.2.45
func (c *RPCli) GetRemoteTime() cli.ResponseTime
GetRemoteTime 获取对端时间
func (*RPCli) RemoveProcedure ¶ added in v0.1.37
RemoveProcedure 删除过程
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) GTPRTTSampling ¶ added in v0.2.45
func (ctor RPCliCreator) GTPRTTSampling(n int) 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) ReduceCP ¶ added in v0.2.48
func (ctor RPCliCreator) ReduceCP(b bool) 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.