remove unneccesary file

This commit is contained in:
Aiden McClelland
2021-09-09 16:05:01 -06:00
committed by Aiden McClelland
parent 0847389cd1
commit f3c6edc5c6
2 changed files with 1 additions and 47 deletions

View File

@@ -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;

View File

@@ -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)
}