use serde::{Deserialize, Serialize};
use std::sync::Arc;
pub const HOOK_ON_REQUEST: i32 = 1;
pub const HOOK_ON_REQUEST_BODY: i32 = 2;
pub const HOOK_ON_RESPONSE: i32 = 3;
pub const HOOK_ON_RESPONSE_BODY: i32 = 4;
pub const HOOK_ON_LOGGING: i32 = 5;
#[derive(Serialize, Deserialize)]
pub struct WasmInput {
pub config: Arc<str>,
pub body: Option<Vec<u8>>,
pub request_id: Option<String>,
pub request_ts: Option<i64>,
}
#[derive(Serialize, Deserialize)]
pub struct WasmOutput {
pub body: Option<Vec<u8>>,
pub respond: Option<WasmRespond>,
}
#[derive(Serialize, Deserialize)]
pub struct WasmRespond {
pub status: u16,
pub headers: Vec<(String, String)>,
pub body: Vec<u8>,
}
#[derive(Serialize, Deserialize)]
pub struct WasmPluginInfo {
pub name: String,
pub version: String,
pub description: String,
pub default_config: String,
pub readme: Option<String>,
}