hive-sh4re: wire_time serde adaptor - timestamps as rfc3339 on the wire
This commit is contained in:
parent
e5e62ad2e6
commit
cf3ac49729
5 changed files with 181 additions and 5 deletions
|
|
@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
|
|||
pub mod assets;
|
||||
pub mod paths;
|
||||
pub mod priv_proto;
|
||||
pub mod wire_time;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Host admin socket — /run/hyperhive/host.sock
|
||||
|
|
@ -198,9 +199,14 @@ pub struct Approval {
|
|||
/// hive-c0re refreshes this + re-renders the card for re-review.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub fetched_sha: Option<String>,
|
||||
#[serde(with = "crate::wire_time::iso")]
|
||||
pub requested_at: i64,
|
||||
pub status: ApprovalStatus,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[serde(
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none",
|
||||
with = "crate::wire_time::iso_opt"
|
||||
)]
|
||||
pub resolved_at: Option<i64>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub note: Option<String>,
|
||||
|
|
@ -437,6 +443,7 @@ pub enum LooseEnd {
|
|||
id: i64,
|
||||
owner: String,
|
||||
message: String,
|
||||
#[serde(with = "crate::wire_time::iso")]
|
||||
due_at: i64,
|
||||
age_seconds: u64,
|
||||
},
|
||||
|
|
@ -1402,16 +1409,26 @@ pub struct WireSchedule {
|
|||
pub body: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub interval_seconds: Option<u64>,
|
||||
#[serde(with = "crate::wire_time::iso")]
|
||||
pub next_fire_at_unix: i64,
|
||||
#[serde(with = "crate::wire_time::iso")]
|
||||
pub created_at_unix: i64,
|
||||
pub source: WireScheduleSource,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[serde(
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none",
|
||||
with = "crate::wire_time::iso_opt"
|
||||
)]
|
||||
pub cancelled_at_unix: Option<i64>,
|
||||
/// Set while the schedule is paused. Worker skips paused rows;
|
||||
/// they keep their `next_fire_at_unix` so resuming at any time
|
||||
/// fires at the next intended instant (no catch-up clamp needed
|
||||
/// — a paused schedule simply slips its next fire).
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[serde(
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none",
|
||||
with = "crate::wire_time::iso_opt"
|
||||
)]
|
||||
pub paused_at_unix: Option<i64>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
|
|
@ -1428,9 +1445,17 @@ pub enum WireScheduleSource {
|
|||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct WireScheduleTarget {
|
||||
pub target: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[serde(
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none",
|
||||
with = "crate::wire_time::iso_opt"
|
||||
)]
|
||||
pub cancelled_at_unix: Option<i64>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[serde(
|
||||
default,
|
||||
skip_serializing_if = "Option::is_none",
|
||||
with = "crate::wire_time::iso_opt"
|
||||
)]
|
||||
pub last_fired_at_unix: Option<i64>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub last_result: Option<String>,
|
||||
|
|
|
|||
Loading…
Reference in a new issue