rpcutil

package
v0.2.91 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	NoAddIn = "" // 不使用插件
	NoComp  = "" // 不使用组件
)

Variables

This section is empty.

Functions

func CliRPCPermValidator

func CliRPCPermValidator(cc rpcstack.CallChain, cp callpath.CallPath) bool

CliRPCPermValidator 默认的客户端RPC请求权限验证器,强制客户端只能RPC调用前缀为C_的函数

Types

type EntityProxied

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

EntityProxied 实体代理,用于向实体发送RPC

func ConcurrentProxyEntity

func ConcurrentProxyEntity(svcCtx service.Context, id uid.Id) EntityProxied

ConcurrentProxyEntity 代理实体

func ProxyEntity

func ProxyEntity(provider runtime.CurrentContextProvider, id uid.Id) EntityProxied

ProxyEntity 代理实体

func (EntityProxied) BalanceOnewayRPC

func (p EntityProxied) BalanceOnewayRPC(service, comp, method string, args ...any) error

BalanceOnewayRPC 使用负载均衡模式,向分布式实体目标服务发送单向RPC

func (EntityProxied) BalanceRPC

func (p EntityProxied) BalanceRPC(service, comp, method string, args ...any) async.AsyncRet

BalanceRPC 使用负载均衡模式,向分布式实体目标服务发送RPC

func (EntityProxied) BroadcastCliOnewayRPC

func (p EntityProxied) BroadcastCliOnewayRPC(proc, method string, args ...any) error

BroadcastCliOnewayRPC 向包含实体的所有分组发送单向RPC

func (EntityProxied) BroadcastOnewayRPC

func (p EntityProxied) BroadcastOnewayRPC(excludeSelf bool, service, comp, method string, args ...any) error

BroadcastOnewayRPC 使用广播模式,向分布式实体目标服务发送单向RPC

func (EntityProxied) CliOnewayRPC

func (p EntityProxied) CliOnewayRPC(proc, method string, args ...any) error

CliOnewayRPC 向客户端发送单向RPC

func (EntityProxied) CliRPC

func (p EntityProxied) CliRPC(proc, method string, args ...any) async.AsyncRet

CliRPC 向客户端发送RPC

func (EntityProxied) GetId

func (p EntityProxied) GetId() uid.Id

GetId 获取实体id

func (EntityProxied) GlobalBalanceOnewayRPC

func (p EntityProxied) GlobalBalanceOnewayRPC(excludeSelf bool, comp, method string, args ...any) error

GlobalBalanceOnewayRPC 使用全局负载均衡模式,向分布式实体任意服务发送单向RPC

func (EntityProxied) GlobalBalanceRPC

func (p EntityProxied) GlobalBalanceRPC(excludeSelf bool, comp, method string, args ...any) async.AsyncRet

GlobalBalanceRPC 使用全局负载均衡模式,向分布式实体任意服务发送RPC

func (EntityProxied) GlobalBroadcastOnewayRPC

func (p EntityProxied) GlobalBroadcastOnewayRPC(excludeSelf bool, comp, method string, args ...any) error

GlobalBroadcastOnewayRPC 使用全局广播模式,向分布式实体所有服务发送单向RPC

func (EntityProxied) OnewayRPC

func (p EntityProxied) OnewayRPC(service, comp, method string, args ...any) error

OnewayRPC 向分布式实体目标服务发送单向RPC

func (EntityProxied) RPC

func (p EntityProxied) RPC(service, comp, method string, args ...any) async.AsyncRet

RPC 向分布式实体目标服务发送RPC

type GroupProxied

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

GroupProxied 分组代理,用于向分组发送RPC

func ConcurrentProxyGroup

func ConcurrentProxyGroup(svcCtx service.Context, name string) GroupProxied

ConcurrentProxyGroup 代理分组

func ProxyGroup

func ProxyGroup(provider runtime.CurrentContextProvider, name string) GroupProxied

ProxyGroup 代理分组

func (GroupProxied) CliOnewayRPC

func (p GroupProxied) CliOnewayRPC(proc, method string, args ...any) error

CliOnewayRPC 向分组发送单向RPC

func (GroupProxied) GetAddr

func (p GroupProxied) GetAddr() string

GetAddr 获取分组地址

func (GroupProxied) GetName

func (p GroupProxied) GetName() string

GetName 获取分组名称

type RuntimeProxied

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

RuntimeProxied 运行时代理,用于向实体的运行时发送RPC

func ConcurrentProxyRuntime

func ConcurrentProxyRuntime(svcCtx service.Context, entityId uid.Id) RuntimeProxied

ConcurrentProxyRuntime 代理运行时

func ProxyRuntime

func ProxyRuntime(provider runtime.CurrentContextProvider, entityId uid.Id) RuntimeProxied

ProxyRuntime 代理运行时

func (RuntimeProxied) BalanceOnewayRPC

func (p RuntimeProxied) BalanceOnewayRPC(service, addIn, method string, args ...any) error

BalanceOnewayRPC 使用负载均衡模式,向分布式实体目标服务的运行时发送单向RPC

func (RuntimeProxied) BalanceRPC

func (p RuntimeProxied) BalanceRPC(service, addIn, method string, args ...any) async.AsyncRet

BalanceRPC 使用负载均衡模式,向分布式实体目标服务的运行时发送RPC

func (RuntimeProxied) BroadcastOnewayRPC

func (p RuntimeProxied) BroadcastOnewayRPC(excludeSelf bool, service, addIn, method string, args ...any) error

BroadcastOnewayRPC 使用广播模式,向分布式实体目标服务的运行时发送单向RPC

func (RuntimeProxied) GetEntityId

func (p RuntimeProxied) GetEntityId() uid.Id

GetEntityId 获取实体id

func (RuntimeProxied) GlobalBalanceOnewayRPC

func (p RuntimeProxied) GlobalBalanceOnewayRPC(excludeSelf bool, addIn, method string, args ...any) error

GlobalBalanceOnewayRPC 使用全局负载均衡模式,向分布式实体任意服务的运行时发送单向RPC

func (RuntimeProxied) GlobalBalanceRPC

func (p RuntimeProxied) GlobalBalanceRPC(excludeSelf bool, addIn, method string, args ...any) async.AsyncRet

GlobalBalanceRPC 使用全局负载均衡模式,向分布式实体任意服务的运行时发送RPC

func (RuntimeProxied) GlobalBroadcastOnewayRPC

func (p RuntimeProxied) GlobalBroadcastOnewayRPC(excludeSelf bool, addIn, method string, args ...any) error

GlobalBroadcastOnewayRPC 使用全局广播模式,向分布式实体所有服务的运行时发送单向RPC

func (RuntimeProxied) OnewayRPC

func (p RuntimeProxied) OnewayRPC(service, addIn, method string, args ...any) error

OnewayRPC 向分布式实体目标服务的运行时发送单向RPC

func (RuntimeProxied) RPC

func (p RuntimeProxied) RPC(service, addIn, method string, args ...any) async.AsyncRet

RPC 向分布式实体目标服务的运行时发送RPC

type ServiceProxied

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

ServiceProxied 实体服务,用于向服务发送RPC

func ProxyService

func ProxyService(svcCtx service.Context, service ...string) ServiceProxied

ProxyService 代理服务

func (ServiceProxied) BalanceOnewayRPC

func (p ServiceProxied) BalanceOnewayRPC(addIn, method string, args ...any) error

BalanceOnewayRPC 使用负载均衡模式,向分布式服务发送单向RPC

func (ServiceProxied) BalanceRPC

func (p ServiceProxied) BalanceRPC(addIn, method string, args ...any) async.AsyncRet

BalanceRPC 使用负载均衡模式,向分布式服务发送RPC

func (ServiceProxied) BroadcastOnewayRPC

func (p ServiceProxied) BroadcastOnewayRPC(excludeSelf bool, addIn, method string, args ...any) error

BroadcastOnewayRPC 使用广播模式,向分布式服务发送单向RPC

func (ServiceProxied) GetService

func (p ServiceProxied) GetService() string

GetService 获取服务名

func (ServiceProxied) OnewayRPC

func (p ServiceProxied) OnewayRPC(nodeId uid.Id, addIn, method string, args ...any) error

OnewayRPC 向分布式服务指定节点发送单向RPC

func (ServiceProxied) RPC

func (p ServiceProxied) RPC(nodeId uid.Id, addIn, method string, args ...any) async.AsyncRet

RPC 向分布式服务指定节点发送RPC

Jump to

Keyboard shortcuts

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