rpcli

package
v0.2.51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2024 License: LGPL-2.1 Imports: 20 Imported by: 2

Documentation

Index

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) GetCli added in v0.1.37

func (p *Procedure) GetCli() *RPCli

GetCli 获取RPC客户端

func (*Procedure) GetName added in v0.2.38

func (p *Procedure) GetName() string

GetName 获取名称

func (*Procedure) GetReflected added in v0.1.37

func (p *Procedure) GetReflected() reflect.Value

GetReflected 获取反射值

type RPCli

type RPCli struct {
	*cli.Client
	// contains filtered or unexported fields
}

RPCli RCP客户端

func (*RPCli) AddProcedure added in v0.1.37

func (c *RPCli) AddProcedure(name string, proc any) error

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) OnewayRPC added in v0.2.38

func (c *RPCli) OnewayRPC(service, comp, method string, args ...any) error

OnewayRPC 单向RPC调用

func (*RPCli) RPC

func (c *RPCli) RPC(service, comp, method string, args ...any) async.AsyncRet

RPC RPC调用

func (*RPCli) RemoveProcedure added in v0.1.37

func (c *RPCli) RemoveProcedure(name string) error

RemoveProcedure 删除过程

type RPCliCreator

type RPCliCreator struct {
	// contains filtered or unexported fields
}

RPCliCreator RPC客户端构建器

func CreateRPCli

func CreateRPCli() RPCliCreator

CreateRPCli 创建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) Connect

func (ctor RPCliCreator) Connect(ctx context.Context, endpoint string) (*RPCli, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL