rpcpcsr

package
v0.2.82 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: LGPL-2.1 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUndeliverable                = errors.New("rpc: undeliverable")                     // 无法投递
	ErrTerminated                   = errors.New("rpc: processor terminated")              // 已终止处理
	ErrEntityNotFound               = errors.New("rpc: routing to entity not found")       // 找不到路由会话映射的实体
	ErrSessionNotFound              = errors.New("rpc: routing to session not found")      // 找不到路由实体映射的会话
	ErrGroupNotFound                = errors.New("rpc: group not found")                   // 找不到分组
	ErrGroupChanIsFull              = errors.New("rpc: group send data channel is full")   // 分组发送数据的channel已满
	ErrDistEntityNotFound           = errors.New("rpc: distributed entity not found")      // 找不到分布式实体
	ErrDistEntityNodeNotFound       = errors.New("rpc: distributed entity node not found") // 找不到分布式实体的服务节点
	ErrIncorrectDestAddress         = errors.New("rpc: incorrect destination Address")     // 错误的目的地址
	ErrAddInNotFound                = errors.New("rpc: addIn not found")                   // 找不到插件
	ErrAddInInactive                = errors.New("rpc: addIn is inactive")                 // 插件未激活
	ErrMethodNotFound               = errors.New("rpc: method not found")                  // 找不到方法
	ErrComponentNotFound            = errors.New("rpc: component not found")               // 找不到组件
	ErrMethodParameterCountMismatch = errors.New("rpc: method parameter count mismatch")   // 方法参数数量不匹配
	ErrMethodParameterTypeMismatch  = errors.New("rpc: method parameter type mismatch")    // 方法参数类型不匹配
	ErrPermissionDenied             = errors.New("rpc: permission denied")                 // 权限不足
)

Functions

func CallEntity

func CallEntity(svcCtx service.Context, cc rpcstack.CallChain, entityId uid.Id, component, method string, args variant.Array) (asyncRet async.AsyncRet, err error)

func CallRuntime

func CallRuntime(svcCtx service.Context, cc rpcstack.CallChain, entityId uid.Id, addInName, method string, args variant.Array) (asyncRet async.AsyncRet, err error)

func CallService

func CallService(svcCtx service.Context, cc rpcstack.CallChain, addInName, method string, args variant.Array) (rets variant.Array, err error)

func NewForwardProcessor

func NewForwardProcessor(transitService string, mc gap.IMsgCreator, permValidator PermissionValidator, reduceCP bool) any

NewForwardProcessor RPC转发处理器,用于S<->G的通信

func NewGateProcessor

func NewGateProcessor(mc gap.IMsgCreator) any

NewGateProcessor 创建网关RPC处理器,用于C<->G的通信

func NewServiceProcessor

func NewServiceProcessor(permValidator PermissionValidator, reduceCP bool) any

NewServiceProcessor 创建分布式服务间的RPC处理器

Types

type ICallee

type ICallee interface {
	Callee(method string) reflect.Value
}

type IDeliverer

type IDeliverer interface {
	// Match 是否匹配
	Match(svcCtx service.Context, dst string, cc rpcstack.CallChain, cp callpath.CallPath, oneway bool) bool
	// Request 请求
	Request(svcCtx service.Context, dst string, cc rpcstack.CallChain, cp callpath.CallPath, args []any) async.AsyncRet
	// Notify 通知
	Notify(svcCtx service.Context, dst string, cc rpcstack.CallChain, cp callpath.CallPath, args []any) error
}

IDeliverer RPC投递器接口

type LifecycleInit

type LifecycleInit interface {
	Init(svcCtx service.Context)
}

LifecycleInit RPC处理器生命周期开始

type LifecycleShut

type LifecycleShut interface {
	Shut(svcCtx service.Context)
}

LifecycleShut RPC处理器生命周期结束

type PermissionValidator

type PermissionValidator = generic.Delegate2[rpcstack.CallChain, callpath.CallPath, bool]

PermissionValidator 权限验证器

Jump to

Keyboard shortcuts

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