Add /runner/:name endpoint

This commit is contained in:
Joscha 2023-08-10 21:26:57 +02:00
parent b5bdd49d9c
commit 0253d2d90b
6 changed files with 79 additions and 26 deletions

View file

@ -5,6 +5,7 @@ use time::OffsetDateTime;
use crate::{config::Config, shared::RunnerStatus};
#[derive(Clone)]
pub struct RunnerInfo {
pub secret: String,
pub last_seen: OffsetDateTime,
@ -81,4 +82,8 @@ impl Runners {
.find(|hash| !covered.contains(hash))
.map(|hash| hash as &str)
}
pub fn get(&self, name: &str) -> Option<RunnerInfo> {
self.runners.get(name).cloned()
}
}