From e45e35125e623a8fb683a28f55ad96d42d01a1d0 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 12 Apr 2020 01:40:46 -0400 Subject: rename some stuff to be less confusing --- src/protocol.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/protocol.rs (limited to 'src/protocol.rs') 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, + 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 }, +} -- cgit v1.2.3-54-g00ecf