pub struct PluginDeclaration {
pub tenant_id: String,
pub plugin_id: String,
pub capability_id: String,
pub grpc_authority: String,
pub plugin_version: String,
pub api_version: String,
pub manifest_sha256: String,
pub declared_operations: Vec<String>,
pub labels: HashMap<String, String>,
pub seat_model: SeatModel,
}Expand description
插件对 capability 的完整声明。
字段全部必填是刻意的:这些正是注册契约 v2 里「可选、缺失即降级为 unverified」的那些。协议层必须可选(否则核心升级会打死所有旧插件), 但新写的插件没有理由不填 —— 在这里做成必填,漏填就编译不过。
Fields§
§tenant_id: String§plugin_id: String§capability_id: String本次注册的能力 id。必须出现在 declared_operations 里,
否则 capability 会当场拒绝(清单与注册对不上)。
它不限制插件承接的范围 —— 范围由 declared_operations 决定。
这里填一个最好认的入口即可,它主要出现在路由簿与日志里。
本插件的 gRPC 地址,capability 按它回调。
plugin_version: String§api_version: String§manifest_sha256: String插件清单(plugin.json)的 sha256,用于确认部署物与目录一致。
declared_operations: Vec<String>本插件能处理的 operation 全集。留空即退化为 unverified。
labels: HashMap<String, String>附加标签,例如 health_protocol 声明特殊探活协议。
seat_model: SeatModel计费/授权单位:SeatModel::Tenant(装了全员可用)或
SeatModel::PerUser(还需逐人授权)。
这是产品决策,平台不替插件决定它怎么卖,所以必填。
Implementations§
Trait Implementations§
Source§impl Clone for PluginDeclaration
impl Clone for PluginDeclaration
Source§fn clone(&self) -> PluginDeclaration
fn clone(&self) -> PluginDeclaration
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PluginDeclaration
impl RefUnwindSafe for PluginDeclaration
impl Send for PluginDeclaration
impl Sync for PluginDeclaration
impl Unpin for PluginDeclaration
impl UnsafeUnpin for PluginDeclaration
impl UnwindSafe for PluginDeclaration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request