mirror of
https://github.com/YGGverse/rssto.git
synced 2026-04-02 10:05:32 +00:00
initial commit
This commit is contained in:
parent
8dfc595961
commit
e070db316c
19 changed files with 400 additions and 356 deletions
33
crates/crawler/src/config.rs
Normal file
33
crates/crawler/src/config.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
use serde::Deserialize;
|
||||
use url::Url;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Mysql {
|
||||
pub database: String,
|
||||
pub host: String,
|
||||
pub password: String,
|
||||
pub port: u16,
|
||||
pub user: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Channel {
|
||||
/// RSS feed source
|
||||
pub url: Url,
|
||||
/// Limit channel items (unlimited by default)
|
||||
pub items_limit: Option<usize>,
|
||||
/// Save item title
|
||||
pub persist_item_title: bool,
|
||||
/// Save item description
|
||||
pub persist_item_description: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Config {
|
||||
pub mysql: Mysql,
|
||||
pub channel: Vec<Channel>,
|
||||
/// Update timeout in seconds
|
||||
///
|
||||
/// * None to generate once
|
||||
pub update: Option<u64>,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue