cpa_plugin/lib.rs
1//! Native plugin host for CLIProxyAPI plugins (internal/pluginhost, sdk/pluginabi,
2//! sdk/pluginapi).
3//!
4//! - [`abi`]: C ABI 1, schema 6, method names, the JSON envelope.
5//! - [`gojson`] and [`api`]: Go `encoding/json` and the pluginapi schemas.
6//! - [`native`]: `dlopen` loading, the plugin call and host callback trampolines.
7//! - [`host`]: discovery, load/register/reconfigure/hot reload/unload, priority snapshot.
8//! - [`callbacks`] and [`streams`]: `host.*` callbacks and plugin-fed streams;
9//! [`hostauth`]: `host.auth.*` and `host.affinity.lookup` over the server's
10//! [`hostauth::AuthManager`].
11//! - [`management`]: plugin-declared management and resource routes.
12//! - [`store`]: the plugin store (registries, verified installs, store auth).
13
14pub mod abi;
15pub mod api;
16pub mod auth;
17pub mod callbacks;
18pub mod cli;
19pub mod client;
20pub mod config;
21pub mod executor;
22pub mod gojson;
23pub mod homeplugins;
24pub mod host;
25pub mod hostauth;
26mod hosthttp;
27pub mod hostmodel;
28pub use hosthttp::{go_preflight, go_read_error_text, go_url_error, go_url_error_text};
29pub mod interceptors;
30pub mod management;
31pub mod models;
32#[cfg(unix)]
33pub mod native;
34pub mod platform;
35pub mod quota;
36pub mod routing;
37pub mod rpc;
38#[cfg(unix)]
39mod shadow;
40pub mod store;
41pub mod streams;
42#[cfg(feature = "test-support")]
43pub mod testing;
44pub mod transform;
45
46pub use host::{Host, Record, RegisteredPluginInfo, Snapshot};
47
48/// Go `pluginhost.SupportPluginHeaderValue` (`X-CPA-SUPPORT-PLUGIN`): "1" where native
49/// plugins load, as in Go's cgo builds.
50/// ponytail: Windows DLL loading is not ported, so Windows reports "0".
51pub const SUPPORT_PLUGIN: &str = if cfg!(unix) { "1" } else { "0" };