ferri/ferri-main/src/ap/mod.rs

28 lines
397 B
Rust
Raw Normal View History

2025-04-12 15:16:40 +01:00
use chrono::{DateTime, Utc};
use uuid::Uuid;
2025-04-10 19:40:50 +01:00
2025-04-11 12:29:29 +01:00
pub mod http;
2025-04-10 19:40:50 +01:00
2025-04-12 15:16:40 +01:00
mod activity;
pub use activity::*;
2025-04-11 12:29:29 +01:00
2025-04-12 15:16:40 +01:00
mod user;
pub use user::*;
2025-04-11 12:29:29 +01:00
2025-04-12 15:16:40 +01:00
mod post;
pub use post::*;
2025-04-10 19:40:50 +01:00
2025-04-12 15:16:40 +01:00
pub const AS_CONTEXT: &'static str = "https://www.w3.org/ns/activitystreams";
2025-04-12 11:27:03 +01:00
2025-04-12 15:16:40 +01:00
pub fn new_id() -> String {
Uuid::new_v4().to_string()
}
2025-04-12 15:16:40 +01:00
pub fn new_ts() -> String {
now().to_rfc3339()
2025-04-11 12:29:29 +01:00
}
2025-04-12 15:16:40 +01:00
pub fn now() -> DateTime<Utc> {
Utc::now()
2025-04-10 19:40:50 +01:00
}