Skip to main content

camel_bridge/
spec.rs

1/// Static descriptor for a bridge binary (JMS, XML, or future bridges).
2/// All fields are `&'static str` so constants can be declared at compile time.
3#[derive(Debug, Clone, Copy)]
4pub struct BridgeSpec {
5    /// Human-readable name used in log messages and error strings.
6    pub name: &'static str,
7    /// Environment variable that overrides the binary path (e.g. `CAMEL_JMS_BRIDGE_BINARY_PATH`).
8    pub env_binary_path: &'static str,
9    /// Environment variable that overrides the GitHub Releases base URL.
10    pub env_release_url: &'static str,
11    /// Sub-directory under the shared rust-camel cache root (e.g. `"jms-bridge"`).
12    pub cache_subdir: &'static str,
13    /// Prefix used in GitHub release tag names (e.g. `"jms-bridge-v"`).
14    pub release_tag_prefix: &'static str,
15
16    /// Template for the stderr log file name; `{pid}` is replaced at runtime.
17    /// Example: `"jms-bridge-{pid}.log"`
18    pub log_file_template: &'static str,
19    /// Whether pre-built binaries are available for macOS.
20    /// All bridges use GraalVM CE native-image which works on all platforms.
21    pub macos_supported: bool,
22    /// Whether pre-built binaries are available for Windows.
23    /// All bridges use GraalVM CE native-image which works on all platforms.
24    pub windows_supported: bool,
25}
26
27/// Spec for the JMS bridge (`bridges/jms`).
28pub const JMS_BRIDGE: BridgeSpec = BridgeSpec {
29    name: "jms-bridge",
30    env_binary_path: "CAMEL_JMS_BRIDGE_BINARY_PATH",
31    env_release_url: "CAMEL_JMS_BRIDGE_RELEASE_URL",
32    cache_subdir: "jms-bridge",
33    release_tag_prefix: "jms-bridge-v",
34    log_file_template: "jms-bridge-{pid}.log",
35    macos_supported: true,
36    windows_supported: true,
37};
38
39/// Spec for the XML bridge (`bridges/xml`).
40pub const XML_BRIDGE: BridgeSpec = BridgeSpec {
41    name: "xml-bridge",
42    env_binary_path: "CAMEL_XML_BRIDGE_BINARY_PATH",
43    env_release_url: "CAMEL_XML_BRIDGE_RELEASE_URL",
44    cache_subdir: "xml-bridge",
45    release_tag_prefix: "xml-bridge-v",
46    log_file_template: "xml-bridge-{pid}.log",
47    macos_supported: true,
48    windows_supported: true,
49};
50
51/// Spec for the CXF bridge (`bridges/cxf`).
52pub const CXF_BRIDGE: BridgeSpec = BridgeSpec {
53    name: "cxf-bridge",
54    env_binary_path: "CAMEL_CXF_BRIDGE_BINARY_PATH",
55    env_release_url: "CAMEL_CXF_BRIDGE_RELEASE_URL",
56    cache_subdir: "cxf-bridge",
57    release_tag_prefix: "cxf-bridge-v",
58    log_file_template: "cxf-bridge-{pid}.log",
59    macos_supported: true,
60    windows_supported: true,
61};