Live sync JSON documents over Iroh
This commit is contained in:
parent
741bd202a8
commit
284207eb01
8 changed files with 370 additions and 7 deletions
|
|
@ -213,6 +213,10 @@ pub enum ControlRequest {
|
|||
DocumentGet {
|
||||
name: String,
|
||||
},
|
||||
DocumentSync {
|
||||
node: String,
|
||||
name: String,
|
||||
},
|
||||
PubsubPub {
|
||||
topic: String,
|
||||
message: String,
|
||||
|
|
@ -450,6 +454,16 @@ pub enum ControlResponse {
|
|||
DocumentGet {
|
||||
state: DocumentState,
|
||||
},
|
||||
DocumentSynced {
|
||||
peer_node_id: String,
|
||||
peer_agent_id: String,
|
||||
endpoint_id: String,
|
||||
name: String,
|
||||
updated: bool,
|
||||
allowed: bool,
|
||||
reason: String,
|
||||
note: String,
|
||||
},
|
||||
PubsubPublished {
|
||||
message: PubsubMessage,
|
||||
},
|
||||
|
|
@ -572,6 +586,12 @@ pub enum PeerControlRequest {
|
|||
target: String,
|
||||
nonce: String,
|
||||
},
|
||||
DocumentSync {
|
||||
peer_card: PeerCard,
|
||||
name: String,
|
||||
since_ms: i64,
|
||||
nonce: String,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
|
|
@ -678,6 +698,20 @@ pub enum PeerControlResponse {
|
|||
nonce: String,
|
||||
note: String,
|
||||
},
|
||||
DocumentSynced {
|
||||
node_id: String,
|
||||
agent_id: String,
|
||||
endpoint_id: String,
|
||||
remote_endpoint_id: String,
|
||||
name: String,
|
||||
state: Option<DocumentState>,
|
||||
high_water_ms: i64,
|
||||
allowed: bool,
|
||||
reason: String,
|
||||
evaluated_ops: usize,
|
||||
nonce: String,
|
||||
note: String,
|
||||
},
|
||||
Error {
|
||||
message: String,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue