rpcstack

package
v0.3.68 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: LGPL-2.1 Imports: 6 Imported by: 1

Documentation

Overview

Package rpcstack 提供 runtime 作用域的 RPC 调用链上下文。

该 add-in 保存当前调用链和每次调用关联的变量,供处理器和代理辅助代码 在嵌套 RPC 调用间传递请求元数据。

Index

Constants

This section is empty.

Variables

View Source
var (
	// AddIn 是 RPC 调用链上下文的运行时级 add-in 安装入口。
	AddIn = define.RuntimeAddIn(newRPCStack)
)
View Source
var EmptyCallChain = CallChain{}

EmptyCallChain 表示当前运行时没有正在处理的 RPC 调用。

Functions

func UnsafeRPCStack deprecated

func UnsafeRPCStack(r IRPCStack) _UnsafeRPCStack

UnsafeRPCStack 返回可修改 RPC 调用链内部状态的非安全门面。

Deprecated: 仅供框架 RPC 处理器维护调用上下文,业务代码不应使用。

Types

type Call

type Call = variant.Call

Call 是调用链中的单个调用节点。

type CallChain

type CallChain = variant.CallChain

CallChain 是从入口到当前处理器的 RPC 调用节点序列。

type IRPCStack

type IRPCStack interface {

	// CallChain 返回当前调用链;没有正在处理的 RPC 时返回 EmptyCallChain。
	CallChain() CallChain
	// Variables 返回当前调用的可变变量表;进入下一次调用时会被清空。
	Variables() *Variables
	// contains filtered or unexported methods
}

IRPCStack 暴露当前运行时正在处理的 RPC 调用链及其临时变量。 仅应在所属运行时 goroutine 中访问。

type Variables

type Variables = generic.UnorderedSliceMap[string, any]

Variables 保存当前 RPC 调用期间的运行时本地变量。

Jump to

Keyboard shortcuts

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