Expand description
SDK for building Barbacane WASM plugins.
Provides Request, Response, and Action types, along with
#[barbacane_middleware] and #[barbacane_dispatcher] macros
that generate the required WASM export glue.
§Example
ⓘ
use barbacane_plugin_sdk::prelude::*;
#[barbacane_middleware]
#[derive(serde::Deserialize)]
struct RateLimiter {
quota: u32,
window: u32,
}
impl RateLimiter {
fn on_request(&mut self, req: Request) -> Action<Request> {
Action::Continue(req)
}
fn on_response(&mut self, resp: Response) -> Response {
resp
}
}Modules§
Attribute Macros§
- barbacane_
dispatcher - Re-export proc macros for plugin development. Generates WASM exports for a dispatcher plugin.
- barbacane_
middleware - Re-export proc macros for plugin development. Generates WASM exports for a middleware plugin.