pub struct Context<K: Resource> {
pub controller_id: ControllerId,
pub client: Client,
pub metrics: Arc<ControllerMetrics>,
pub recorder: Recorder,
pub namespace_store: Store<Namespace>,
pub kanidm_store: Store<Kanidm>,
/* private fields */
}Fields§
§controller_id: ControllerIdController ID
client: ClientKubernetes client
metrics: Arc<ControllerMetrics>Prometheus metrics
recorder: RecorderEvent recorder
namespace_store: Store<Namespace>Cache for Namespace resources
kanidm_store: Store<Kanidm>Cache for Kanidm resources
Implementations§
Source§impl<K> Context<K>where
K: Resource + ResourceExt + Lookup + Clone + 'static,
<K as Lookup>::DynamicType: Eq + Hash + Clone,
impl<K> Context<K>where
K: Resource + ResourceExt + Lookup + Clone + 'static,
<K as Lookup>::DynamicType: Eq + Hash + Clone,
pub fn new( controller_id: ControllerId, client: Client, metrics: Arc<ControllerMetrics>, recorder: Recorder, idm_clients: Arc<RwLock<KanidmClients>>, system_clients: Arc<RwLock<KanidmClients>>, namespace_store: Store<Namespace>, kanidm_store: Store<Kanidm>, ) -> Self
pub async fn release_kanidm_clients(&self, kanidm: &Kanidm)
Trait Implementations§
Source§impl<K> BackoffContext<K> for Context<K>where
K: Resource<DynamicType = ()> + ResourceExt + Lookup + Clone + 'static,
<K as Lookup>::DynamicType: Eq + Hash + Clone,
impl<K> BackoffContext<K> for Context<K>where
K: Resource<DynamicType = ()> + ResourceExt + Lookup + Clone + 'static,
<K as Lookup>::DynamicType: Eq + Hash + Clone,
Source§async fn get_backoff(&self, obj_ref: ObjectRef<K>) -> Duration
async fn get_backoff(&self, obj_ref: ObjectRef<K>) -> Duration
Return next duration of the backoff policy for the given object
Source§async fn reset_backoff(&self, obj_ref: ObjectRef<K>)
async fn reset_backoff(&self, obj_ref: ObjectRef<K>)
Reset the backoff policy for the given object
fn metrics(&self) -> &Arc<ControllerMetrics>
Source§impl<K> IdmClientContext<K> for Context<K>where
K: Resource<DynamicType = ()> + ResourceExt + KanidmResource + Lookup + Clone + 'static,
<K as Lookup>::DynamicType: Eq + Hash + Clone,
impl<K> IdmClientContext<K> for Context<K>where
K: Resource<DynamicType = ()> + ResourceExt + KanidmResource + Lookup + Clone + 'static,
<K as Lookup>::DynamicType: Eq + Hash + Clone,
async fn get_idm_client(&self, obj: &K) -> Result<Arc<KanidmClient>>
Source§impl<K> SystemClientContext<K> for Context<K>where
K: Resource<DynamicType = ()> + ResourceExt + KanidmResource + Lookup + Clone + 'static,
<K as Lookup>::DynamicType: Eq + Hash + Clone,
impl<K> SystemClientContext<K> for Context<K>where
K: Resource<DynamicType = ()> + ResourceExt + KanidmResource + Lookup + Clone + 'static,
<K as Lookup>::DynamicType: Eq + Hash + Clone,
async fn get_system_client(&self, obj: &K) -> Result<Arc<KanidmClient>>
Auto Trait Implementations§
impl<K> Freeze for Context<K>
impl<K> !RefUnwindSafe for Context<K>
impl<K> Send for Context<K>
impl<K> Sync for Context<K>
impl<K> Unpin for Context<K>
impl<K> UnsafeUnpin for Context<K>
impl<K> !UnwindSafe for Context<K>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more