rpcutil

package
v0.2.47 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: LGPL-2.1 Imports: 15 Imported by: 3

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func CliRPCPermValidator added in v0.1.93

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 added in v0.1.69

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

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

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

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

func (EntityProxied) BroadcastOnewayRPC added in v0.2.38

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

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

func (EntityProxied) CliOnewayRPC added in v0.2.38

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

func (p EntityProxied) GetId() uid.Id

GetId 获取实体id

func (EntityProxied) GlobalBalanceOnewayRPC added in v0.2.38

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

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

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

func (EntityProxied) OnewayRPC added in v0.2.38

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 added in v0.1.69

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

ConcurrentProxyGroup 代理分组

func ProxyGroup

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

ProxyGroup 代理分组

func (GroupProxied) CliOnewayRPC added in v0.2.38

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

CliOnewayRPC 向分组发送单向RPC

func (GroupProxied) GetAddr added in v0.1.93

func (p GroupProxied) GetAddr() string

GetAddr 获取分组地址

func (GroupProxied) GetName added in v0.2.33

func (p GroupProxied) GetName() string

GetName 获取分组名称

type RuntimeProxied

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

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

func ConcurrentProxyRuntime added in v0.1.69

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

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

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

func (RuntimeProxied) BalanceRPC

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

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

func (RuntimeProxied) BroadcastOnewayRPC added in v0.2.38

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

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

func (RuntimeProxied) GetEntityId added in v0.1.37

func (p RuntimeProxied) GetEntityId() uid.Id

GetEntityId 获取实体id

func (RuntimeProxied) GlobalBalanceOnewayRPC added in v0.2.38

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

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

func (RuntimeProxied) GlobalBalanceRPC

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

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

func (RuntimeProxied) GlobalBroadcastOnewayRPC added in v0.2.38

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

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

func (RuntimeProxied) OnewayRPC added in v0.2.38

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

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

func (RuntimeProxied) RPC

func (p RuntimeProxied) RPC(service, plugin, 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 added in v0.2.38

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

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

func (ServiceProxied) BalanceRPC

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

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

func (ServiceProxied) BroadcastOnewayRPC added in v0.2.38

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

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

func (ServiceProxied) GetService added in v0.1.37

func (p ServiceProxied) GetService() string

GetService 获取服务名

func (ServiceProxied) OnewayRPC added in v0.2.38

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

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

func (ServiceProxied) RPC

func (p ServiceProxied) RPC(nodeId uid.Id, plugin, 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