pub trait BackendProjectStore: Send + Sync {
// Required methods
fn change_repository(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn ChangeRepository + Send>, DomainError>;
fn module_repository(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn ModuleRepository + Send>, DomainError>;
fn task_repository(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn TaskRepository + Send>, DomainError>;
fn task_mutation_service(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn TaskMutationService + Send>, DomainError>;
fn spec_repository(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn SpecRepository + Send>, DomainError>;
fn pull_artifact_bundle(
&self,
org: &str,
repo: &str,
change_id: &str,
) -> Result<ArtifactBundle, BackendError>;
fn push_artifact_bundle(
&self,
org: &str,
repo: &str,
change_id: &str,
bundle: &ArtifactBundle,
) -> Result<PushResult, BackendError>;
fn archive_change(
&self,
org: &str,
repo: &str,
change_id: &str,
) -> Result<ArchiveResult, BackendError>;
fn ensure_project(&self, org: &str, repo: &str) -> Result<(), DomainError>;
fn project_exists(&self, org: &str, repo: &str) -> bool;
}Expand description
Port for resolving {org}/{repo} to project-level repositories.
The backend server uses this trait to obtain domain repository instances
for a given project namespace. Implementations live in ito-core and
may be backed by the filesystem or a database.
This trait is Send + Sync so it can be shared across async request
handlers via Arc.
Required Methods§
Sourcefn change_repository(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn ChangeRepository + Send>, DomainError>
fn change_repository( &self, org: &str, repo: &str, ) -> Result<Box<dyn ChangeRepository + Send>, DomainError>
Obtain a change repository for the given project.
Sourcefn module_repository(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn ModuleRepository + Send>, DomainError>
fn module_repository( &self, org: &str, repo: &str, ) -> Result<Box<dyn ModuleRepository + Send>, DomainError>
Obtain a module repository for the given project.
Sourcefn task_repository(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn TaskRepository + Send>, DomainError>
fn task_repository( &self, org: &str, repo: &str, ) -> Result<Box<dyn TaskRepository + Send>, DomainError>
Obtain a task repository for the given project.
Sourcefn task_mutation_service(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn TaskMutationService + Send>, DomainError>
fn task_mutation_service( &self, org: &str, repo: &str, ) -> Result<Box<dyn TaskMutationService + Send>, DomainError>
Obtain a task mutation service for the given project.
Sourcefn spec_repository(
&self,
org: &str,
repo: &str,
) -> Result<Box<dyn SpecRepository + Send>, DomainError>
fn spec_repository( &self, org: &str, repo: &str, ) -> Result<Box<dyn SpecRepository + Send>, DomainError>
Obtain a promoted spec repository for the given project.
Sourcefn pull_artifact_bundle(
&self,
org: &str,
repo: &str,
change_id: &str,
) -> Result<ArtifactBundle, BackendError>
fn pull_artifact_bundle( &self, org: &str, repo: &str, change_id: &str, ) -> Result<ArtifactBundle, BackendError>
Pull the latest artifact bundle for a change from backend-managed storage.
Sourcefn push_artifact_bundle(
&self,
org: &str,
repo: &str,
change_id: &str,
bundle: &ArtifactBundle,
) -> Result<PushResult, BackendError>
fn push_artifact_bundle( &self, org: &str, repo: &str, change_id: &str, bundle: &ArtifactBundle, ) -> Result<PushResult, BackendError>
Push an updated artifact bundle into backend-managed storage.
Sourcefn archive_change(
&self,
org: &str,
repo: &str,
change_id: &str,
) -> Result<ArchiveResult, BackendError>
fn archive_change( &self, org: &str, repo: &str, change_id: &str, ) -> Result<ArchiveResult, BackendError>
Archive a change in backend-managed storage and mirror promoted specs.
Sourcefn ensure_project(&self, org: &str, repo: &str) -> Result<(), DomainError>
fn ensure_project(&self, org: &str, repo: &str) -> Result<(), DomainError>
Ensure the project directory/storage structure exists.
Called before first write to a project. Implementations should create whatever backing store structure is needed.
Sourcefn project_exists(&self, org: &str, repo: &str) -> bool
fn project_exists(&self, org: &str, repo: &str) -> bool
Check whether the project exists in the store.