covert_types/
mount.rs

1use std::time::Duration;
2
3use serde::{Deserialize, Serialize};
4use uuid::Uuid;
5
6use crate::backend::BackendType;
7
8#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
9pub struct MountConfig {
10    #[serde(with = "humantime_serde")]
11    pub default_lease_ttl: Duration,
12    #[serde(with = "humantime_serde")]
13    pub max_lease_ttl: Duration,
14}
15
16impl Default for MountConfig {
17    fn default() -> Self {
18        Self {
19            default_lease_ttl: Duration::from_secs(60 * 30),
20            max_lease_ttl: Duration::from_secs(60 * 60 * 4),
21        }
22    }
23}
24
25#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
26pub struct MountEntry {
27    pub id: Uuid,
28    pub path: String,
29    pub config: MountConfig,
30    pub backend_type: BackendType,
31    pub namespace_id: String,
32}