gitea-issue-bot/src/conf.rs

46 lines
1.6 KiB
Rust
Raw Normal View History

2020-09-10 21:33:34 +02:00
/* This file is part of issue-bot.
*
* issue-bot is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* issue-bot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with issue-bot. If not, see <https://www.gnu.org/licenses/>.
*/
2019-09-20 11:59:13 +02:00
use serde::Deserialize;
#[derive(Deserialize, Debug)]
2022-09-24 14:30:31 +02:00
#[serde(deny_unknown_fields)]
2020-09-10 21:33:34 +02:00
pub struct Configuration {
2022-09-24 14:30:31 +02:00
/// eg. meli-issues becomes [meli-issues]
2019-09-20 11:59:13 +02:00
pub tag: String,
2022-09-24 14:30:31 +02:00
/// your bot's authentication token from Gitea's Swagger
2019-09-20 11:59:13 +02:00
pub auth_token: String,
2022-09-24 14:30:31 +02:00
/// eg. for issues@meli.delivery the local part is issues
2019-09-20 11:59:13 +02:00
pub local_part: String,
2022-09-24 14:30:31 +02:00
/// eg. for issues@meli.delivery the domain is meli.delivery
2019-09-20 11:59:13 +02:00
pub domain: String,
2022-09-24 14:30:31 +02:00
/// eg. "https://git.meli.delivery"
2019-09-20 11:59:13 +02:00
pub base_url: String,
2022-09-24 14:30:31 +02:00
/// eg. "meli/meli"
2019-09-20 11:59:13 +02:00
pub repo: String,
2022-09-24 14:30:31 +02:00
/// The bot's name that will be displayed in signatures of sent replies
2019-09-20 11:59:13 +02:00
pub bot_name: String,
2022-09-24 14:30:31 +02:00
/// The bot's login username
2019-09-20 11:59:13 +02:00
pub bot_username: String,
2022-09-24 14:30:31 +02:00
/// the command to pipe an email to
2019-09-20 11:59:13 +02:00
pub mailer: String,
2022-09-24 14:30:31 +02:00
/// file to write logs
2020-09-10 21:33:34 +02:00
pub log_file: String,
2022-09-24 14:30:31 +02:00
/// don't actually email anything
#[serde(default)]
pub dry_run: bool,
2019-09-20 11:59:13 +02:00
}