diff options
Diffstat (limited to 'src/protocol.rs')
-rw-r--r-- | src/protocol.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/protocol.rs b/src/protocol.rs new file mode 100644 index 0000000..8d7cd69 --- /dev/null +++ b/src/protocol.rs @@ -0,0 +1,27 @@ +#[derive(serde::Serialize, serde::Deserialize, Debug)] +pub struct Request { + pub tty: Option<String>, + pub action: Action, +} + +#[derive(serde::Serialize, serde::Deserialize, Debug)] +#[serde(tag = "type")] +pub enum Action { + Login, + Unlock, + Lock, + Sync, + Decrypt { cipherstring: String }, + // add + // update + // remove + Quit, +} + +#[derive(serde::Serialize, serde::Deserialize, Debug)] +#[serde(tag = "type")] +pub enum Response { + Ack, + Error { error: String }, + Decrypt { plaintext: String }, +} |