pub struct HTTPProxyRegistryWriter { /* private fields */ }Expand description
Register scanned modules as HTTP proxy modules in the registry.
Each module’s execute() sends an HTTP request to the target API
instead of calling the handler directly.
Implementations§
Source§impl HTTPProxyRegistryWriter
impl HTTPProxyRegistryWriter
Sourcepub fn new(
base_url: String,
auth_header_factory: Option<Box<dyn Fn() -> HashMap<String, String> + Send + Sync>>,
timeout_secs: f64,
) -> Self
pub fn new( base_url: String, auth_header_factory: Option<Box<dyn Fn() -> HashMap<String, String> + Send + Sync>>, timeout_secs: f64, ) -> Self
Create a new HTTP proxy writer.
base_url: Base URL of the target API.auth_header_factory: Optional callable returning HTTP headers for auth.timeout_secs: HTTP request timeout in seconds.
Sourcepub fn write(
&self,
modules: &[ScannedModule],
registry: &mut Registry,
) -> Vec<WriteResult>
pub fn write( &self, modules: &[ScannedModule], registry: &mut Registry, ) -> Vec<WriteResult>
Register each ScannedModule as an HTTP proxy module.
Auto Trait Implementations§
impl Freeze for HTTPProxyRegistryWriter
impl !RefUnwindSafe for HTTPProxyRegistryWriter
impl Send for HTTPProxyRegistryWriter
impl Sync for HTTPProxyRegistryWriter
impl Unpin for HTTPProxyRegistryWriter
impl UnsafeUnpin for HTTPProxyRegistryWriter
impl !UnwindSafe for HTTPProxyRegistryWriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more