| Crates.io | vanguard-plugin-sdk |
| lib.rs | vanguard-plugin-sdk |
| version | 0.1.4 |
| created_at | 2025-03-17 12:55:01.974891+00 |
| updated_at | 2025-03-17 22:11:43.740246+00 |
| description | SDK for developing Vanguard plugins |
| homepage | |
| repository | https://github.com/find-how/pioneer-vanguard |
| max_upload_size | |
| id | 1595441 |
| size | 28,010 |
Development SDK for creating plugins for the Vanguard version manager.
This SDK provides utilities, macros, and templates for easily creating plugins that can be loaded and used by the Vanguard version manager.
Use the Vanguard CLI:
vanguard plugin create my-plugin --description "My custom plugin" --author "Your Name"
use serde::{Deserialize, Serialize};
use vanguard_plugin_sdk::{metadata, plugin, plugin_config, PluginMetadata, PluginMetadataBuilder};
#[derive(Debug, Serialize, Deserialize)]
pub struct MyPluginConfig {
pub value: String,
}
plugin_config!(MyPluginConfig, serde_json::json!({
"type": "object",
"required": ["value"],
"properties": {
"value": {
"type": "string",
"description": "Example configuration value"
}
}
}));
#[derive(Debug)]
pub struct MyPlugin {
metadata: PluginMetadata,
config: Option<MyPluginConfig>,
}
impl MyPlugin {
pub fn new() -> Self {
Self {
metadata: metadata()
.name("my-plugin")
.version("0.1.0")
.description("My custom plugin")
.author("Your Name")
.build(),
config: None,
}
}
}
plugin!(MyPlugin, MyPluginConfig);
MIT