first of many small code documentation
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
ad1d272e2a
commit
92641d0628
3 changed files with 14 additions and 2 deletions
|
@ -9,9 +9,10 @@ use ruma::api::client::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// generated MXC ID (`media-id`) length
|
||||||
const MXC_LENGTH: usize = 32;
|
const MXC_LENGTH: usize = 32;
|
||||||
|
|
||||||
/// # `GET /_matrix/media/r0/config`
|
/// # `GET /_matrix/media/v3/config`
|
||||||
///
|
///
|
||||||
/// Returns max upload size.
|
/// Returns max upload size.
|
||||||
pub async fn get_media_config_route(
|
pub async fn get_media_config_route(
|
||||||
|
@ -22,7 +23,7 @@ pub async fn get_media_config_route(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # `POST /_matrix/media/r0/upload`
|
/// # `POST /_matrix/media/v3/upload`
|
||||||
///
|
///
|
||||||
/// Permanently save media in the server.
|
/// Permanently save media in the server.
|
||||||
///
|
///
|
||||||
|
@ -58,6 +59,7 @@ pub async fn create_content_route(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// helper method to fetch remote media from other servers over federation
|
||||||
pub async fn get_remote_content(
|
pub async fn get_remote_content(
|
||||||
mxc: &str,
|
mxc: &str,
|
||||||
server_name: &ruma::ServerName,
|
server_name: &ruma::ServerName,
|
||||||
|
|
|
@ -68,7 +68,14 @@ pub use unversioned::*;
|
||||||
pub use user_directory::*;
|
pub use user_directory::*;
|
||||||
pub use voip::*;
|
pub use voip::*;
|
||||||
|
|
||||||
|
/// generated device ID length
|
||||||
pub const DEVICE_ID_LENGTH: usize = 10;
|
pub const DEVICE_ID_LENGTH: usize = 10;
|
||||||
|
|
||||||
|
/// generated user access token length
|
||||||
pub const TOKEN_LENGTH: usize = 32;
|
pub const TOKEN_LENGTH: usize = 32;
|
||||||
|
|
||||||
|
/// generated user session ID length
|
||||||
pub const SESSION_ID_LENGTH: usize = 32;
|
pub const SESSION_ID_LENGTH: usize = 32;
|
||||||
|
|
||||||
|
/// auto-generated password length
|
||||||
pub const AUTO_GEN_PASSWORD_LENGTH: usize = 25;
|
pub const AUTO_GEN_PASSWORD_LENGTH: usize = 25;
|
||||||
|
|
|
@ -14,10 +14,13 @@ mod proxy;
|
||||||
|
|
||||||
use self::proxy::ProxyConfig;
|
use self::proxy::ProxyConfig;
|
||||||
|
|
||||||
|
/// all the config options for conduwuit
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
/// [`IpAddr`] conduwuit will listen on (can be IPv4 or IPv6)
|
||||||
#[serde(default = "default_address")]
|
#[serde(default = "default_address")]
|
||||||
pub address: IpAddr,
|
pub address: IpAddr,
|
||||||
|
/// default TCP port conduwuit will listen on
|
||||||
#[serde(default = "default_port")]
|
#[serde(default = "default_port")]
|
||||||
pub port: u16,
|
pub port: u16,
|
||||||
pub tls: Option<TlsConfig>,
|
pub tls: Option<TlsConfig>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue