pub struct UpstreamHandler { /* private fields */ }
Expand description
Handler for Pingora’s request_filter
phase
Implementations§
Source§impl UpstreamHandler
impl UpstreamHandler
Sourcepub async fn upstream_peer(
_session: &mut Session,
ctx: &mut Option<UpstreamContext>,
) -> Result<Box<HttpPeer>, Box<Error>>
pub async fn upstream_peer( _session: &mut Session, ctx: &mut Option<UpstreamContext>, ) -> Result<Box<HttpPeer>, Box<Error>>
This function should be called during the upstream_peer
phase of Pingora Proxy to produce
the upstream peer which was determined in the request_filter
phase. Will return a 404 Not
Found error if no upstream is configured.
Trait Implementations§
Source§impl Debug for UpstreamHandler
impl Debug for UpstreamHandler
Source§impl RequestFilter for UpstreamHandler
impl RequestFilter for UpstreamHandler
Source§type Conf = UpstreamConf
type Conf = UpstreamConf
Configuration type of this handler.
Source§type CTX = Option<UpstreamContext>
type CTX = Option<UpstreamContext>
Per-request state of this handler, see
pingora_proxy::ProxyHttp::CTX
Source§fn new_ctx() -> Self::CTX
fn new_ctx() -> Self::CTX
Creates a new sate object, see
pingora_proxy::ProxyHttp::new_ctx
Source§fn request_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
ctx: &'life2 mut Self::CTX,
) -> Pin<Box<dyn Future<Output = Result<RequestFilterResult, Box<Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn request_filter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session: &'life1 mut Session,
ctx: &'life2 mut Self::CTX,
) -> Pin<Box<dyn Future<Output = Result<RequestFilterResult, Box<Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Handler to run during Pingora’s
request_filter
state, see
pingora_proxy::ProxyHttp::request_filter
. This uses a different return type to account
for the existence of multiple request filters.Source§fn new(conf: Self::Conf) -> Result<Self, Box<Error>>
fn new(conf: Self::Conf) -> Result<Self, Box<Error>>
Creates a new instance of the handler from its configuration.
Auto Trait Implementations§
impl Freeze for UpstreamHandler
impl RefUnwindSafe for UpstreamHandler
impl Send for UpstreamHandler
impl Sync for UpstreamHandler
impl Unpin for UpstreamHandler
impl UnwindSafe for UpstreamHandler
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