Trait lal::Backend
[−]
[src]
pub trait Backend { fn get_versions(&self, name: &str, loc: Option<&str>) -> LalResult<Vec<u32>>; fn get_latest_version(
&self,
name: &str,
loc: Option<&str>
) -> LalResult<u32>; fn get_tarball_url(
&self,
name: &str,
version: Option<u32>,
loc: Option<&str>
) -> LalResult<Component>; fn upload_artifact_dir(
&self,
name: &str,
version: u32,
env: Option<&str>
) -> LalResult<()>; fn raw_download(&self, url: &str, dest: &PathBuf) -> LalResult<()>; fn get_cache_dir(&self) -> String; }
Properties a storage backend of artifacts should have
We are not really relying on Artifactory specific quirks in our default usage so that in case it fails it can be switched over. We do rely on there being a basic API that can implement this trait though.
Required Methods
fn get_versions(&self, name: &str, loc: Option<&str>) -> LalResult<Vec<u32>>
Get a list of versions for a component
fn get_latest_version(&self, name: &str, loc: Option<&str>) -> LalResult<u32>
Get the latest version of a component
fn get_tarball_url(
&self,
name: &str,
version: Option<u32>,
loc: Option<&str>
) -> LalResult<Component>
&self,
name: &str,
version: Option<u32>,
loc: Option<&str>
) -> LalResult<Component>
Get the tarball url of a Component
in a backend location
If no version is given, return latest
fn upload_artifact_dir(
&self,
name: &str,
version: u32,
env: Option<&str>
) -> LalResult<()>
&self,
name: &str,
version: u32,
env: Option<&str>
) -> LalResult<()>
Publish a release build (ARTIFACT dir) to a specific location
fn raw_download(&self, url: &str, dest: &PathBuf) -> LalResult<()>
Raw dowlnload of a url to a destination
fn get_cache_dir(&self) -> String
Return the base directory to be used to dump cached downloads
This has to be in here for CachedBackend
to have a straight dependency
Implementors
impl Backend for ArtifactoryBackend