imgurs/imgurs-cli/src/config/mod.rs

38 lines
876 B
Rust
Raw Normal View History

2022-06-22 18:34:16 +00:00
use serde::{Deserialize, Serialize};
2022-01-24 22:15:55 +00:00
2022-01-22 21:02:51 +00:00
pub mod toml;
2022-01-24 22:15:55 +00:00
2022-07-08 09:54:48 +00:00
/// Configuration schema
2022-05-18 18:52:47 +00:00
#[derive(Debug, Serialize, Deserialize)]
2022-01-24 22:15:55 +00:00
pub struct Config {
2022-07-08 09:54:48 +00:00
/// Imgur API configuration options
2022-01-24 22:15:55 +00:00
pub imgur: ConfigImgur,
2022-07-08 09:54:48 +00:00
/// Notification options
2022-01-24 22:15:55 +00:00
pub notification: ConfigNotification,
2022-07-08 09:54:48 +00:00
/// Clipboard options
pub clipboard: ConfigClipboard,
2022-01-24 22:15:55 +00:00
}
2022-07-08 09:54:48 +00:00
/// Imgur API configuration options
2022-05-18 18:52:47 +00:00
#[derive(Debug, Serialize, Deserialize)]
2022-01-24 22:15:55 +00:00
pub struct ConfigImgur {
2022-07-08 09:54:48 +00:00
/// Imgur Client ID
2022-01-24 22:15:55 +00:00
pub id: String,
2022-07-08 09:54:48 +00:00
/// Imgur Domain (e.g. if you have a imgur proxy)
pub image_cdn: String,
2022-01-24 22:15:55 +00:00
}
2022-07-08 09:54:48 +00:00
/// Notification options
2022-05-18 18:52:47 +00:00
#[derive(Debug, Serialize, Deserialize)]
2022-01-24 22:15:55 +00:00
pub struct ConfigNotification {
2022-07-08 09:54:48 +00:00
/// Send notification
2022-01-24 22:15:55 +00:00
pub enabled: bool,
}
2022-07-08 09:54:48 +00:00
/// Clipboard options
2022-05-18 18:52:47 +00:00
#[derive(Debug, Serialize, Deserialize)]
pub struct ConfigClipboard {
2022-07-08 09:54:48 +00:00
/// Copy image url to clipboard
pub enabled: bool,
}