Switch of several config attributes to pub(crate)

This commit is contained in:
Neshura 2023-12-17 14:43:00 +01:00
parent dd11620ffa
commit 5ddb6b3b75
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -1,12 +1,13 @@
use std::{error::Error};
use serde_derive::{Deserialize, Serialize};
use crate::config::PostBody::Description;
#[derive(Serialize, Deserialize, Clone)]
pub(crate) struct Config {
instance: String,
status_post_url: Option<String>,
config_reload_seconds: u32,
series: Vec<SeriesConfig>,
pub(crate) instance: String,
pub(crate) status_post_url: Option<String>,
pub(crate) config_reload_seconds: u32,
pub(crate) series: Vec<SeriesConfig>,
}
impl Config {
@ -40,26 +41,26 @@ impl Default for Config {
#[derive(Debug, Serialize, Deserialize, Clone)]
pub(crate) struct SeriesConfig {
slug: String,
parted: bool,
prepub_community: PostConfig,
volume_community: PostConfig,
pub(crate) slug: String,
pub(crate) parted: bool,
pub(crate) prepub_community: PostConfig,
pub(crate) volume_community: PostConfig,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub(crate) struct PostConfig {
community_name: String,
pin_settings: PinConfig,
post_body: PostBody,
pub(crate) community_name: String,
pub(crate) pin_settings: PinConfig,
pub(crate) post_body: PostBody,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub(crate) struct PinConfig {
pin_new_post_local: bool,
pin_new_post_community: bool,
pub(crate) pin_new_post_local: bool,
pub(crate) pin_new_post_community: bool,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(tag = "body_type", content = "body_content")]
pub(crate) enum PostBody {
None,