fixed some clippy warnings; added TODOs for later
This commit is contained in:
parent
bc09317d4b
commit
cb1a1c24b7
@ -27,7 +27,7 @@ impl Images {
|
|||||||
.iter()
|
.iter()
|
||||||
.map(|d| super::TagDetails {
|
.map(|d| super::TagDetails {
|
||||||
arch: Some(d.architecture.clone()),
|
arch: Some(d.architecture.clone()),
|
||||||
size: Some(d.size.clone()),
|
size: Some(d.size),
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
}
|
}
|
||||||
@ -43,7 +43,7 @@ pub struct DockerHub {
|
|||||||
|
|
||||||
impl DockerHub {
|
impl DockerHub {
|
||||||
/// fetches tag information with a repository name in the form of organization/repository or library/repository in the case of official images from docker
|
/// fetches tag information with a repository name in the form of organization/repository or library/repository in the case of official images from docker
|
||||||
pub fn new(repo: &str) -> Result<super::Repo, Error> {
|
pub fn create_repo(repo: &str) -> Result<super::Repo, Error> {
|
||||||
let request = format!("https://hub.docker.com/v2/repositories/{}/tags", repo);
|
let request = format!("https://hub.docker.com/v2/repositories/{}/tags", repo);
|
||||||
Self::with_url(&request)
|
Self::with_url(&request)
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ impl Tag {
|
|||||||
let now = chrono::Utc::now();
|
let now = chrono::Utc::now();
|
||||||
let rfc3339 = DateTime::parse_from_rfc3339(last_updated).unwrap();
|
let rfc3339 = DateTime::parse_from_rfc3339(last_updated).unwrap();
|
||||||
let dif = now - rfc3339.with_timezone(&chrono::Utc);
|
let dif = now - rfc3339.with_timezone(&chrono::Utc);
|
||||||
format!("{}", format_time_nice(dif))
|
format_time_nice(dif)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
format!("{} vor {} [{}]", self.name, dif, arch)
|
format!("{} vor {} [{}]", self.name, dif, arch)
|
||||||
@ -96,13 +96,14 @@ impl Repo {
|
|||||||
Err(e) => return Err(Error::Converting(format!("{}", e))),
|
Err(e) => return Err(Error::Converting(format!("{}", e))),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//TODO change according to registry
|
||||||
// if ®istry == "ghcr.io" {
|
// if ®istry == "ghcr.io" {
|
||||||
// //
|
// //
|
||||||
// } else {
|
// } else {
|
||||||
// dockerhub::DockerHub::new(repo)
|
// dockerhub::DockerHub::new(repo)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
dockerhub::DockerHub::new(&repo)
|
dockerhub::DockerHub::create_repo(&repo)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_url(url: &str) -> Result<Self, Error> {
|
pub fn with_url(url: &str) -> Result<Self, Error> {
|
||||||
|
Loading…
Reference in New Issue
Block a user