pub struct OkrRepository { /* private fields */ }Expand description
Repository for OKR persistence operations
Implementations§
Source§impl OkrRepository
impl OkrRepository
Sourcepub async fn from_config() -> Result<Self>
pub async fn from_config() -> Result<Self>
Create repository from Config::data_dir() or fallback to temp
Sourcepub async fn create_okr(&self, okr: Okr) -> Result<Okr>
pub async fn create_okr(&self, okr: Okr) -> Result<Okr>
Create a new OKR
Sourcepub async fn update_okr(&self, okr: Okr) -> Result<Okr>
pub async fn update_okr(&self, okr: Okr) -> Result<Okr>
Update an existing OKR
Sourcepub async fn delete_okr(&self, id: Uuid) -> Result<bool>
pub async fn delete_okr(&self, id: Uuid) -> Result<bool>
Delete an OKR by ID
Sourcepub async fn query_okrs_by_status(&self, status: OkrStatus) -> Result<Vec<Okr>>
pub async fn query_okrs_by_status(&self, status: OkrStatus) -> Result<Vec<Okr>>
Query OKRs by status
Sourcepub async fn query_okrs_by_tenant(&self, tenant_id: &str) -> Result<Vec<Okr>>
pub async fn query_okrs_by_tenant(&self, tenant_id: &str) -> Result<Vec<Okr>>
Query OKRs by tenant
Sourcepub async fn create_run(&self, run: OkrRun) -> Result<OkrRun>
pub async fn create_run(&self, run: OkrRun) -> Result<OkrRun>
Create a new OKR run
Sourcepub async fn update_run(&self, run: OkrRun) -> Result<OkrRun>
pub async fn update_run(&self, run: OkrRun) -> Result<OkrRun>
Update a run
Sourcepub async fn delete_run(&self, id: Uuid) -> Result<bool>
pub async fn delete_run(&self, id: Uuid) -> Result<bool>
Delete a run
Sourcepub async fn query_runs_by_okr(&self, okr_id: Uuid) -> Result<Vec<OkrRun>>
pub async fn query_runs_by_okr(&self, okr_id: Uuid) -> Result<Vec<OkrRun>>
Query runs by OKR ID
Sourcepub async fn query_runs_by_status(
&self,
status: OkrRunStatus,
) -> Result<Vec<OkrRun>>
pub async fn query_runs_by_status( &self, status: OkrRunStatus, ) -> Result<Vec<OkrRun>>
Query runs by status
Sourcepub async fn query_runs_by_correlation(
&self,
correlation_id: &str,
) -> Result<Vec<OkrRun>>
pub async fn query_runs_by_correlation( &self, correlation_id: &str, ) -> Result<Vec<OkrRun>>
Query runs by correlation ID
Sourcepub async fn query_runs_by_checkpoint(
&self,
checkpoint_id: &str,
) -> Result<Vec<OkrRun>>
pub async fn query_runs_by_checkpoint( &self, checkpoint_id: &str, ) -> Result<Vec<OkrRun>>
Query runs by relay checkpoint ID
Sourcepub async fn query_runs_by_session(
&self,
session_id: &str,
) -> Result<Vec<OkrRun>>
pub async fn query_runs_by_session( &self, session_id: &str, ) -> Result<Vec<OkrRun>>
Query runs by session ID
Sourcepub async fn clear_cache(&self)
pub async fn clear_cache(&self)
Clear the in-memory cache (useful for forcing reload from disk)
Sourcepub async fn stats(&self) -> Result<OkrRepositoryStats>
pub async fn stats(&self) -> Result<OkrRepositoryStats>
Get statistics about the repository
Auto Trait Implementations§
impl Freeze for OkrRepository
impl !RefUnwindSafe for OkrRepository
impl Send for OkrRepository
impl Sync for OkrRepository
impl Unpin for OkrRepository
impl !UnwindSafe for OkrRepository
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
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> Pointable for T
impl<T> Pointable for T
Source§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 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