docs: Add detailed descriptions to files header

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-07-22 10:15:50 +03:00
parent 0e26557128
commit 3e4141f30e
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F
23 changed files with 60 additions and 14 deletions

View file

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! Database utilities for the OxideTalis homeserver. //! Database trait extensions.
mod in_chat_requests; mod in_chat_requests;
mod out_chat_requests; mod out_chat_requests;

View file

@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! Database extension to work with the whitelist table //! Database extension for the `users_status` table
use std::num::{NonZeroU32, NonZeroU8}; use std::num::{NonZeroU32, NonZeroU8};
@ -25,7 +25,7 @@ use sea_orm::DatabaseConnection;
use crate::{errors::ServerResult, websocket::errors::WsError}; use crate::{errors::ServerResult, websocket::errors::WsError};
/// Extension trait for the `DatabaseConnection` to work with the whitelist /// Extension trait for the `DatabaseConnection` to work with the users status
/// table /// table
pub trait UsersStatusExt { pub trait UsersStatusExt {
/// Returns true if the `whitelister` has whitelisted the /// Returns true if the `whitelister` has whitelisted the

View file

@ -14,6 +14,8 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! Oxidetalis errors types, internal, api and websocket errors.
use sea_orm::DbErr; use sea_orm::DbErr;
use crate::{routes::ApiError, websocket::errors::WsError}; use crate::{routes::ApiError, websocket::errors::WsError};

View file

@ -14,6 +14,8 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! Global trait extensions for the Oxidetalis server.
use std::sync::Arc; use std::sync::Arc;
use chrono::Utc; use chrono::Utc;

View file

@ -14,6 +14,8 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! Oxidetalis API errors.
use salvo::{ use salvo::{
http::StatusCode, http::StatusCode,
oapi::{Components as OapiComponents, EndpointOutRegister, Operation as OapiOperation}, oapi::{Components as OapiComponents, EndpointOutRegister, Operation as OapiOperation},

View file

@ -14,6 +14,8 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! Oxidetalis server routes, all the routes of the server.
use std::env; use std::env;
use std::sync::Arc; use std::sync::Arc;

View file

@ -14,6 +14,8 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! Oxidetalis api schemas.
use salvo::{ use salvo::{
http::{header, StatusCode}, http::{header, StatusCode},
oapi::{ oapi::{

View file

@ -14,6 +14,8 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! User API schemas
use std::str::FromStr; use std::str::FromStr;
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};

View file

@ -14,6 +14,8 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! Oxidetalis server utilities, utilities shared across the crate.
use std::str::FromStr; use std::str::FromStr;
use chrono::Utc; use chrono::Utc;

View file

@ -14,6 +14,9 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>. // along with this program. If not, see <https://gnu.org/licenses/agpl-3.0>.
//! Oxidetalis WebSocket server implementation, handling the WebSocket
//! connections.
use std::{collections::HashMap, sync::Arc, time::Duration}; use std::{collections::HashMap, sync::Arc, time::Duration};
use chrono::Utc; use chrono::Utc;

View file

@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Cipher types
use std::{fmt, str::FromStr}; use std::{fmt, str::FromStr};
use base58::{FromBase58, ToBase58}; use base58::{FromBase58, ToBase58};

View file

@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Serde serialization and deserialization for types (feature `serde`)
use base58::FromBase58; use base58::FromBase58;
use serde::{de::Error as DeError, Deserialize, Serialize}; use serde::{de::Error as DeError, Deserialize, Serialize};

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database entities
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Entity for `in_chat_requests` table
use chrono::Utc; use chrono::Utc;
use sea_orm::entity::prelude::*; use sea_orm::entity::prelude::*;

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database entities
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
#![doc = include_str!("../README.md")]
pub mod incoming_chat_requests; pub mod incoming_chat_requests;
pub mod outgoing_chat_requests; pub mod outgoing_chat_requests;
pub mod prelude; pub mod prelude;

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database entities
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Entity for `out_chat_requests` table
use chrono::Utc; use chrono::Utc;
use sea_orm::entity::prelude::*; use sea_orm::entity::prelude::*;

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database entities
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Predefined imports for the entities, all the entities are re-exported here
pub use sea_orm::{ pub use sea_orm::{
ActiveModelTrait, ActiveModelTrait,
ColumnTrait, ColumnTrait,

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database entities
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Entity for `users` table
use sea_orm::entity::prelude::*; use sea_orm::entity::prelude::*;
use crate::prelude::*; use crate::prelude::*;

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database entities
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Entity for `users_status` table
use chrono::Utc; use chrono::Utc;
use sea_orm::entity::prelude::*; use sea_orm::entity::prelude::*;

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database migrations
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Migration to create the `in_chat_requests` table, a table for incoming chat
//! requests from other users
use sea_orm_migration::prelude::*; use sea_orm_migration::prelude::*;
use crate::create_users_table::Users; use crate::create_users_table::Users;

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database migrations
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Migration to create the `out_chat_requests` table, a table for outgoing chat
//! requests to other users
use sea_orm_migration::prelude::*; use sea_orm_migration::prelude::*;
use crate::create_users_table::Users; use crate::create_users_table::Users;

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database migrations
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Migration to create the `users_status` table, a table for storing
//! whitelist/blacklist status of users
use std::fmt; use std::fmt;
use sea_orm::sea_query::extension::postgres::Type; use sea_orm::sea_query::extension::postgres::Type;

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database migrations
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
//! Migration to create the `users` table, a table for storing server users.
use sea_orm_migration::prelude::*; use sea_orm_migration::prelude::*;
#[derive(DeriveMigrationName)] #[derive(DeriveMigrationName)]

View file

@ -1,4 +1,4 @@
// OxideTalis Messaging Protocol homeserver core implementation // OxideTalis Messaging Protocol homeserver database migrations
// Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors // Copyright (C) 2024 Awiteb <a@4rs.nl>, OxideTalis Contributors
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,6 +19,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
#![doc = include_str!("../README.md")]
use sea_orm_migration::prelude::*; use sea_orm_migration::prelude::*;
pub use sea_orm_migration::MigratorTrait; pub use sea_orm_migration::MigratorTrait;