Documentation
¶
Overview ¶
Package dispatch 通用派发守卫:allow 矩阵 + 深度上限 + 自派发拒绝。 拓扑边由宿主经 EdgeSource 抽象提供(编译期校验过的 allow 矩阵),守卫运行期只读; 被拒绝的派发返回结构化 *DenyError——调用方不得转述、不得降级,按失败兜底如实上报。 沉淀自 bianque engine/dispatch(v0.9.5):注册表耦合改为 EdgeSource 接口。
Index ¶
Constants ¶
View Source
const ( ReasonNotAllowed = "not_allowed" // caller→callee 不在 allow 矩阵 ReasonDepthExceeded = "depth_exceeded" // 派发深度超限 ReasonSelfDispatch = "self_dispatch" // 自派发 )
拒绝原因词表(DenyError.Reason 的取值全集,审计消费方按常量比对而非裸字符串)。
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DenyError ¶
type DenyError struct {
Caller string
Callee string
Depth int
Reason string // ReasonNotAllowed | ReasonDepthExceeded | ReasonSelfDispatch
}
DenyError 结构化拒绝(宿主可原样落审计事件载荷)。
type EdgeSource ¶
type EdgeSource interface {
Slugs() []string
// DispatchAllow 返回 slug 允许派发的目标列表(slug 未登记返回 nil)。
DispatchAllow(slug string) []string
}
EdgeSource 拓扑边来源:宿主注册表的最小投影(slug 全集 + 各 slug 允许派发的目标)。
Click to show internal directories.
Click to hide internal directories.