Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Approver ¶
type Approver interface {
RequestApproval(ctx context.Context, toolID string, payload any) (Approval, error)
}
Approver 是工具端看到的审批能力接口。调用方只需知道能发起审批请求, 不需要知道模式切换、前端信令等实现细节。
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service 管理审批流程,实现 Approver 接口。 零超时,goroutine 睡在 channel 上等待前端响应。 mode 为 "auto" 时自动批准所有请求,无需前端交互。
func NewService ¶
NewService 创建审批服务,默认手动模式。initialMode 为空时默认 "manual"。
Click to show internal directories.
Click to hide internal directories.