Working server list add
This commit is contained in:
@@ -2,10 +2,12 @@ use serde::{Deserialize, Serialize};
|
||||
use std::{collections::HashMap, fs};
|
||||
use tauri::{AppHandle, Manager};
|
||||
|
||||
use crate::protocol::ServerMeta;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct KnownServer {
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
pub meta: ServerMeta,
|
||||
pub public_key: String,
|
||||
pub is_secure: bool,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
pub mod commands;
|
||||
pub mod protocol;
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ClientMeta {}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ServerMeta {
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(tag = "method")]
|
||||
pub enum ClientMethod {
|
||||
Initialized {
|
||||
public_key: String,
|
||||
signature: String,
|
||||
|
||||
timestamp: u64,
|
||||
hostname: String,
|
||||
},
|
||||
|
||||
Error {
|
||||
error: Cow<'static, str>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(tag = "method")]
|
||||
pub enum ServerMethod {
|
||||
Initialize {
|
||||
public_key: String,
|
||||
signature: String,
|
||||
|
||||
timestamp: u64,
|
||||
hostname: String,
|
||||
},
|
||||
|
||||
Meta(ClientMeta),
|
||||
|
||||
Error {
|
||||
error: String,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user