use super::*;
#[derive(Clone, Data, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct UpdateServerConfig {
pub(crate) store_root: PathBuf,
pub(crate) host: String,
#[get(type(copy))]
pub(crate) port: u16,
#[get(type(copy))]
pub(crate) heartbeat_ms: u64,
#[get(type(copy))]
pub(crate) retry_ms: u64,
#[get(type(copy))]
pub(crate) replay_capacity: usize,
#[get(type(copy))]
pub(crate) watch_poll_ms: u64,
#[get(type(copy))]
pub(crate) max_artifact_bytes: u64,
#[get(type(copy))]
pub(crate) once: bool,
}
#[derive(Clone, Data, Debug, Default, Deserialize, Eq, New, PartialEq, Serialize)]
pub struct ChannelPointer {
pub(crate) project: String,
pub(crate) channel: String,
pub(crate) track: String,
#[get(type(copy))]
pub(crate) active_release_seq: u64,
pub(crate) manifest_sha256: String,
#[get(type(copy))]
pub(crate) updated_at_unix: u64,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, New, PartialEq, Serialize)]
pub struct StoredReleaseEvent {
#[get(type(copy))]
pub(crate) event_id: u64,
pub(crate) event: ReleaseActivatedEvent,
}
#[derive(Clone, Data, Debug, Eq, New, PartialEq)]
pub struct UpdateStore {
pub(crate) root: PathBuf,
#[new(skip)]
#[get(type(copy))]
pub(crate) max_artifact_bytes: u64,
}
#[derive(Debug)]
pub(crate) struct UpdateWriterLockGuard {
pub(crate) lock_path: PathBuf,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, New, PartialEq, Serialize)]
pub struct StageReport {
pub(crate) stage_id: String,
pub(crate) project: String,
pub(crate) channel: String,
#[get(type(copy))]
pub(crate) blob_count: usize,
#[get(type(copy))]
pub(crate) total_bytes: u64,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, New, PartialEq, Serialize)]
pub struct PublishReport {
pub(crate) project: String,
pub(crate) channel: String,
pub(crate) track: String,
#[get(type(copy))]
pub(crate) from_release: u64,
#[get(type(copy))]
pub(crate) to_release: u64,
#[new(skip)]
#[get(skip)]
pub(crate) rollback_of: Option<u64>,
pub(crate) manifest_sha256: String,
#[new(skip)]
pub(crate) affected_routes: Vec<String>,
#[new(skip)]
#[get(type(copy))]
pub(crate) blobs_written: usize,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, New, PartialEq, Serialize)]
pub struct ChannelStatusEntry {
pub(crate) project: String,
pub(crate) channel: String,
pub(crate) pointer: ChannelPointer,
#[get(type(copy))]
pub(crate) release_count: usize,
#[get(type(copy))]
pub(crate) event_count: usize,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, New, PartialEq, Serialize)]
pub struct UpdateStoreStatus {
pub(crate) store_root: String,
#[get(type(copy))]
pub(crate) blob_count: usize,
#[get(type(copy))]
pub(crate) blob_total_bytes: u64,
pub(crate) channels: Vec<ChannelStatusEntry>,
}
#[derive(Clone, Data, Debug, Deserialize, Eq, New, PartialEq, Serialize)]
pub struct UpdateServerReport {
pub(crate) store_root: String,
pub(crate) url: String,
pub(crate) manifest_route: String,
pub(crate) blob_route: String,
pub(crate) events_route: String,
#[get(type(copy))]
pub(crate) once: bool,
}
#[cfg(feature = "update-server")]
#[derive(Clone)]
pub struct UpdateServerState {
pub(crate) store: UpdateStore,
pub(crate) sse_hub: SseHub,
pub(crate) sse_config: SseConfig,
pub(crate) dispatched_seqs: Arc<Mutex<HashMap<(String, String), u64>>>,
pub(crate) running: Arc<AtomicBool>,
}
#[cfg(feature = "update-server")]
pub struct UpdateServerHandle {
pub(crate) address: SocketAddr,
pub(crate) state: Arc<UpdateServerState>,
pub(crate) control: Option<ServerControlHook>,
pub(crate) runtime: Option<runtime::Runtime>,
}
#[cfg(feature = "update-server")]
pub struct ManifestRouteHook;
#[cfg(feature = "update-server")]
pub struct BlobRouteHook;
#[cfg(feature = "update-server")]
pub struct EventsRouteHook;