moon_pdk_api/extension.rs
1use crate::context::MoonContext;
2use schematic::Schema;
3use warpgate_api::*;
4
5// METADATA
6
7api_struct!(
8 /// Input passed to the `register_extension` function.
9 pub struct RegisterExtensionInput {
10 /// ID of the toolchain, as it was configured.
11 pub id: String,
12 }
13);
14
15api_struct!(
16 /// Output returned from the `register_extension` function.
17 pub struct RegisterExtensionOutput {
18 /// Schema shape of the tool's configuration.
19 #[serde(default, skip_serializing_if = "Option::is_none")]
20 pub config_schema: Option<Schema>,
21
22 /// Name of the extension.
23 pub name: String,
24
25 /// Optional description about what the extension does.
26 pub description: Option<String>,
27
28 /// Version of the plugin.
29 pub plugin_version: String,
30 }
31);
32
33// EXECUTE
34
35api_struct!(
36 /// Input passed to the `execute_extension` function.
37 pub struct ExecuteExtensionInput {
38 /// Custom arguments passed on the command line.
39 pub args: Vec<String>,
40
41 /// Current moon context.
42 pub context: MoonContext,
43 }
44);