rpcutil

package
v0.1.82 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	NoPlugin = ""
	NoComp   = ""
)

Variables

View Source
var (
	ErrDistEntityNotFound     = errors.New("rpc: distributed entity not found")
	ErrDistEntityNodeNotFound = errors.New("rpc: distributed entity node not found")
)

Functions

func ClientRPCPermValidator added in v0.1.77

func ClientRPCPermValidator(callChain rpcstack.CallChain, cp callpath.CallPath) bool

Types

type EntityProxied

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

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

func ConcurrentProxyEntity added in v0.1.69

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

ConcurrentProxyEntity 代理实体

func ProxyEntity

func ProxyEntity(ctx runtime.Context, 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) BroadcastOneWayRPC

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

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

func (EntityProxied) CliRPC

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

CliRPC 向客户端发送RPC

func (EntityProxied) CliRPCToEntity

func (p EntityProxied) CliRPCToEntity(entityId uid.Id, method string, args ...any) async.AsyncRet

CliRPCToEntity 向客户端实体发送RPC

func (EntityProxied) GetId added in v0.1.37

func (p EntityProxied) GetId() uid.Id

GetId 获取实体id

func (EntityProxied) GlobalBalanceOneWayRPC

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

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

func (EntityProxied) GlobalBalanceRPC

func (p EntityProxied) GlobalBalanceRPC(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) OneWayCliRPC

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

OneWayCliRPC 向客户端发送单向RPC

func (EntityProxied) OneWayCliRPCToEntity

func (p EntityProxied) OneWayCliRPCToEntity(entityId uid.Id, method string, args ...any) error

OneWayCliRPCToEntity 向客户端实体发送单向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 added in v0.1.69

func ConcurrentProxyGroup(ctx service.Context, id uid.Id) GroupProxied

ConcurrentProxyGroup 代理分组

func ProxyGroup

func ProxyGroup(ctx runtime.Context, id uid.Id) GroupProxied

ProxyGroup 代理分组

func (GroupProxied) GetId added in v0.1.37

func (p GroupProxied) GetId() uid.Id

GetId 获取分组id

func (GroupProxied) OneWayCliRPC

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

OneWayCliRPC 向分组客户端发送单向RPC

func (GroupProxied) OneWayCliRPCToEntity

func (p GroupProxied) OneWayCliRPCToEntity(entityId uid.Id, method string, args ...any) error

OneWayCliRPCToEntity 向分组客户端实体发送单向RPC

type RuntimeProxied

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

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

func ConcurrentProxyRuntime added in v0.1.69

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

ConcurrentProxyRuntime 代理运行时

func ProxyRuntime

func ProxyRuntime(ctx runtime.Context, entityId uid.Id) RuntimeProxied

ProxyRuntime 代理运行时

func (RuntimeProxied) BalanceOneWayRPC

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

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

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

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

func (RuntimeProxied) GlobalBalanceRPC

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

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

func (RuntimeProxied) GlobalBroadcastOneWayRPC

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

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

func (RuntimeProxied) OneWayRPC

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(ctx service.Context, service ...string) ServiceProxied

ProxyService 代理服务

func (ServiceProxied) BalanceOneWayRPC

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

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

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