pub struct MyCtx {
pub(crate) cos_mapping: Arc<RwLock<HashMap<String, CosMapItem>>>,
pub(crate) hmac_keystore: Arc<RwLock<HashMap<String, String>>>,
pub(crate) secrets_cache: SecretsCache,
pub(crate) auth_cache: AuthCache,
pub(crate) validator: Option<PyObject>,
pub(crate) bucket_creds_fetcher: Option<PyObject>,
pub(crate) hmac_fetcher: Option<PyObject>,
pub(crate) is_presigned: Option<bool>,
pub(crate) stream_state: Option<StreamingState>,
pub(crate) cached_bucket: Option<String>,
pub(crate) cached_bucket_config: Option<CosMapItem>,
}Expand description
Per-request context threaded through the Pingora middleware chain.
A fresh MyCtx is created by MyProxy::new_ctx for every incoming
connection and is discarded when the request completes.
Fields§
§cos_mapping: Arc<RwLock<HashMap<String, CosMapItem>>>§hmac_keystore: Arc<RwLock<HashMap<String, String>>>§secrets_cache: SecretsCache§auth_cache: AuthCache§validator: Option<PyObject>§bucket_creds_fetcher: Option<PyObject>§hmac_fetcher: Option<PyObject>§is_presigned: Option<bool>§stream_state: Option<StreamingState>§cached_bucket: Option<String>Bucket name parsed from the request path in request_filter, reused by
later stages to avoid redundant parse_path calls and map lock acquires.
cached_bucket_config: Option<CosMapItem>CosMapItem resolved in request_filter and reused by upstream_peer
to avoid a second cos_mapping RwLock read on every request.
TODO(perf-2): done — see upstream_peer
Auto Trait Implementations§
impl Freeze for MyCtx
impl !RefUnwindSafe for MyCtx
impl Send for MyCtx
impl Sync for MyCtx
impl Unpin for MyCtx
impl UnsafeUnpin for MyCtx
impl !UnwindSafe for MyCtx
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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