mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 03:32:36 +08:00
feat: init verge config struct
This commit is contained in:
parent
4bb9e10946
commit
5b826a3767
1
src-tauri/src/config/mod.rs
Normal file
1
src-tauri/src/config/mod.rs
Normal file
|
@ -0,0 +1 @@
|
|||
pub mod verge;
|
41
src-tauri/src/config/verge.rs
Normal file
41
src-tauri/src/config/verge.rs
Normal file
|
@ -0,0 +1,41 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Define the verge.yaml's schema
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct VergeConfig {
|
||||
/// current profile's name
|
||||
pub current: Option<u32>,
|
||||
|
||||
/// profile list
|
||||
pub profiles: Option<Vec<ProfileData>>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct ProfileData {
|
||||
/// profile name
|
||||
pub name: Option<String>,
|
||||
/// profile file
|
||||
pub file: Option<String>,
|
||||
/// current mode
|
||||
pub mode: Option<String>,
|
||||
/// source url
|
||||
pub url: Option<String>,
|
||||
/// selected infomation
|
||||
pub selected: Option<Vec<ProfileSelected>>,
|
||||
/// user info
|
||||
pub user_info: Option<ProfileUserInfo>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
pub struct ProfileSelected {
|
||||
pub name: Option<String>,
|
||||
pub now: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Copy, Deserialize, Serialize)]
|
||||
pub struct ProfileUserInfo {
|
||||
pub upload: u64,
|
||||
pub download: u64,
|
||||
pub total: u64,
|
||||
pub expire: u64,
|
||||
}
|
Loading…
Reference in New Issue
Block a user