pub struct GithubIngestor {
pub user: String,
pub since: NaiveDate,
pub until: NaiveDate,
pub mode: String,
pub include_reviews: bool,
pub fetch_details: bool,
pub throttle_ms: u64,
pub token: Option<String>,
pub api_base: String,
pub cache: Option<ApiCache>,
}Fields§
§user: String§since: NaiveDate§until: NaiveDate§mode: String“merged” or “created”
include_reviews: bool§fetch_details: bool§throttle_ms: u64§token: Option<String>§api_base: StringGitHub API base URL (for GHES). Default: https://api.github.com
cache: Option<ApiCache>Optional cache for API responses
Implementations§
Source§impl GithubIngestor
impl GithubIngestor
Sourcepub fn new(user: String, since: NaiveDate, until: NaiveDate) -> Self
pub fn new(user: String, since: NaiveDate, until: NaiveDate) -> Self
Create a new GitHub ingestor for the given user and date range.
Defaults to merged mode with no reviews, no cache, and no throttle.
§Examples
use shiplog_ingest_github::GithubIngestor;
use chrono::NaiveDate;
let ingestor = GithubIngestor::new(
"octocat".into(),
NaiveDate::from_ymd_opt(2025, 1, 1).unwrap(),
NaiveDate::from_ymd_opt(2025, 4, 1).unwrap(),
);
assert_eq!(ingestor.mode, "merged");Sourcepub fn with_cache(self, cache_dir: impl Into<PathBuf>) -> Result<Self>
pub fn with_cache(self, cache_dir: impl Into<PathBuf>) -> Result<Self>
Enable caching with the given cache directory.
§Examples
use shiplog_ingest_github::GithubIngestor;
use chrono::NaiveDate;
let ingestor = GithubIngestor::new(
"octocat".into(),
NaiveDate::from_ymd_opt(2025, 1, 1).unwrap(),
NaiveDate::from_ymd_opt(2025, 4, 1).unwrap(),
).with_cache("./cache")?;Sourcepub fn with_in_memory_cache(self) -> Result<Self>
pub fn with_in_memory_cache(self) -> Result<Self>
Enable in-memory caching (useful for testing).
§Examples
use shiplog_ingest_github::GithubIngestor;
use chrono::NaiveDate;
let ingestor = GithubIngestor::new(
"octocat".into(),
NaiveDate::from_ymd_opt(2025, 1, 1).unwrap(),
NaiveDate::from_ymd_opt(2025, 4, 1).unwrap(),
).with_in_memory_cache().unwrap();
assert!(ingestor.cache.is_some());Trait Implementations§
Source§impl Debug for GithubIngestor
impl Debug for GithubIngestor
Source§impl Ingestor for GithubIngestor
impl Ingestor for GithubIngestor
Source§fn ingest(&self) -> Result<IngestOutput>
fn ingest(&self) -> Result<IngestOutput>
Fetch events from the data source and return them with coverage metadata.
Auto Trait Implementations§
impl !Freeze for GithubIngestor
impl !RefUnwindSafe for GithubIngestor
impl Send for GithubIngestor
impl !Sync for GithubIngestor
impl Unpin for GithubIngestor
impl UnsafeUnpin for GithubIngestor
impl !UnwindSafe for GithubIngestor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more