minccino/src/meta/mod.rs
2022-09-23 22:39:17 -07:00

24 lines
575 B
Rust

pub mod routes;
#[cfg(test)]
mod test;
use rocket::serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
#[serde(crate = "rocket::serde", rename_all = "kebab-case")]
pub struct CIMetadata {
pub instance_id: String,
pub local_hostname: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub public_keys: Option<Vec<String>>,
}
#[derive(Debug, Responder)]
pub enum MetaError {
#[response(status = 404)]
NotFound(()),
#[response(status = 500)]
InternalServerError(()),
}
type MetaResponse<T> = Result<T, MetaError>;