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
|
2022-02-25 17:24:24 +00:00
|
|
|
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)
|
2022-03-10 21:02:03 +00:00
|
|
|
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-02-25 17:24:24 +00:00
|
|
|
|
2022-07-08 09:54:48 +00:00
|
|
|
/// Clipboard options
|
2022-05-18 18:52:47 +00:00
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
2022-02-25 17:24:24 +00:00
|
|
|
pub struct ConfigClipboard {
|
2022-07-08 09:54:48 +00:00
|
|
|
/// Copy image url to clipboard
|
2022-02-25 17:24:24 +00:00
|
|
|
pub enabled: bool,
|
|
|
|
}
|