mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
remove unneccesary file
This commit is contained in:
committed by
Aiden McClelland
parent
0847389cd1
commit
f3c6edc5c6
@@ -26,8 +26,8 @@ pub mod manager;
|
||||
pub mod middleware;
|
||||
pub mod migration;
|
||||
pub mod net;
|
||||
pub mod registry;
|
||||
pub mod s9pk;
|
||||
pub mod setup;
|
||||
pub mod shutdown;
|
||||
pub mod sound;
|
||||
pub mod ssh;
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
use emver::VersionRange;
|
||||
use tokio_compat_02::FutureExt;
|
||||
|
||||
use crate::s9pk::manifest::Manifest;
|
||||
use crate::{Error, ResultExt as _};
|
||||
|
||||
pub async fn manifest(id: &str, version: &VersionRange) -> Result<Manifest, Error> {
|
||||
let manifest: Manifest = reqwest::get(&format!(
|
||||
"{}/manifest/{}?spec={}",
|
||||
&*crate::APP_REGISTRY_URL,
|
||||
id,
|
||||
version
|
||||
))
|
||||
.compat()
|
||||
.await
|
||||
.with_kind(crate::ErrorKind::Network)?
|
||||
.error_for_status()
|
||||
.with_kind(crate::ErrorKind::Registry)?
|
||||
.json()
|
||||
.await
|
||||
.with_kind(crate::ErrorKind::Deserialization)?;
|
||||
Ok(manifest)
|
||||
}
|
||||
|
||||
pub async fn version(id: &str, version: &VersionRange) -> Result<emver::Version, Error> {
|
||||
#[derive(serde::Deserialize)]
|
||||
struct VersionRes {
|
||||
version: emver::Version,
|
||||
}
|
||||
|
||||
let version: VersionRes = reqwest::get(&format!(
|
||||
"{}/version/{}?spec={}",
|
||||
&*crate::APP_REGISTRY_URL,
|
||||
id,
|
||||
version
|
||||
))
|
||||
.compat()
|
||||
.await
|
||||
.with_kind(crate::ErrorKind::Network)?
|
||||
.error_for_status()
|
||||
.with_kind(crate::ErrorKind::Registry)?
|
||||
.json()
|
||||
.await
|
||||
.with_kind(crate::ErrorKind::Deserialization)?;
|
||||
Ok(version.version)
|
||||
}
|
||||
Reference in New Issue
Block a user