Global, mono-binary to libraries and binaries

This separates the previous mono-binary setup into separate libraries
and binaries. Specifically it split the old since api/ingestor binary
into an Atproto, and DB library, as well as an api, and ingestor binary.

Atproto Lib
Was mostly untouched. The original URI implementation was changed to use
FromStr, otherwise only imports were changed.

DB Lib
Is mostly unused, so there wasn't much that needed to be changed. Some
new files were added so that future work on it can hit the ground
running.

Api Binary
Is almost entirely the same. Imports were changed and the ingestor code
of main was removed.

Ingestor Binary
Was almost entirely refactored. An interface to made injestors was
added, and it was modularized. The only shared code is in
Ingestor.start(), and collections.rs's macros, but that is mostly
boilerplate.
This commit is contained in:
Julia Lange 2025-05-22 15:22:43 -07:00
parent 45acaaa601
commit 30e5de8c79
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto
31 changed files with 582 additions and 636 deletions

View file

@ -0,0 +1,36 @@
// @generated - This file is generated by esquema-codegen (forked from atrium-codegen). DO NOT EDIT.
//!Definitions for the `my.spoor.content.external` namespace.
use atrium_api::types::TryFromUnknown;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct RecordData {
///User defined overrides for the returned content
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub overrides: core::option::Option<atrium_api::types::Union<RecordOverridesRefs>>,
///All the data needed to query the content from the source
pub queryable: atrium_api::types::Union<RecordQueryableRefs>,
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub titles: core::option::Option<Vec<crate::lexicons::my::spoor::content::title::Main>>,
}
pub type Record = atrium_api::types::Object<RecordData>;
impl From<atrium_api::types::Unknown> for RecordData {
fn from(value: atrium_api::types::Unknown) -> Self {
Self::try_from_unknown(value).unwrap()
}
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Tvdbv4Data {
pub id: i64,
pub r#type: String,
}
pub type Tvdbv4 = atrium_api::types::Object<Tvdbv4Data>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum RecordOverridesRefs {}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum RecordQueryableRefs {
#[serde(rename = "my.spoor.content.external#tvdbv4")]
Tvdbv4(Box<Tvdbv4>),
}

View file

@ -0,0 +1,44 @@
// @generated - This file is generated by esquema-codegen (forked from atrium-codegen). DO NOT EDIT.
//!Definitions for the `my.spoor.content.media` namespace.
use atrium_api::types::TryFromUnknown;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct RecordData {
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub duration_data: core::option::Option<
atrium_api::types::Union<RecordDurationDataRefs>,
>,
///Client-declared timestamp for when this activity was last updated
pub last_updated: atrium_api::types::string::Datetime,
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub poster_image: core::option::Option<atrium_api::types::BlobRef>,
pub titles: Vec<crate::lexicons::my::spoor::content::title::Main>,
}
pub type Record = atrium_api::types::Object<RecordData>;
impl From<atrium_api::types::Unknown> for RecordData {
fn from(value: atrium_api::types::Unknown) -> Self {
Self::try_from_unknown(value).unwrap()
}
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct BookData {
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub chapters: core::option::Option<usize>,
}
pub type Book = atrium_api::types::Object<BookData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct TelevisionData {
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub episodes: core::option::Option<usize>,
}
pub type Television = atrium_api::types::Object<TelevisionData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum RecordDurationDataRefs {
#[serde(rename = "my.spoor.content.media#television")]
MySpoorContentMediaTelevision(Box<crate::lexicons::my::spoor::content::media::Television>),
#[serde(rename = "my.spoor.content.media#book")]
MySpoorContentMediaBook(Box<crate::lexicons::my::spoor::content::media::Book>),
}

View file

@ -0,0 +1,19 @@
// @generated - This file is generated by esquema-codegen (forked from atrium-codegen). DO NOT EDIT.
//!Definitions for the `my.spoor.content.title` namespace.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct MainData {
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub lang: core::option::Option<atrium_api::types::string::Language>,
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub translation_type: core::option::Option<atrium_api::types::string::Nsid>,
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub value: core::option::Option<String>,
}
pub type Main = atrium_api::types::Object<MainData>;
///A phonetic transcription of the native title such that when read it will sound like the native title.
pub const TITLE_HOMOPHONIC: &str = "my.spoor.content.title#titleHomophonic";
///The title in its native script
pub const TITLE_NATIVE: &str = "my.spoor.content.title#titleNative";
///A translation of the title
pub const TITLE_TRANSLATION: &str = "my.spoor.content.title#titleTranslation";