pub struct RepoConfigLoader { /* private fields */ }Expand description
Repository configuration loader with caching
Fetches .meritocrab.toml from repository root via GitHub API
and caches it with configurable TTL. Falls back to default config
if file is missing or invalid.
Implementations§
Source§impl RepoConfigLoader
impl RepoConfigLoader
Sourcepub fn new(github_client: Arc<GithubApiClient>, cache_ttl_seconds: u64) -> Self
pub fn new(github_client: Arc<GithubApiClient>, cache_ttl_seconds: u64) -> Self
Create new config loader
§Arguments
github_client- GitHub API client for fetching config filescache_ttl_seconds- TTL for cached configs in seconds
Sourcepub async fn get_config(&self, repo_owner: &str, repo_name: &str) -> RepoConfig
pub async fn get_config(&self, repo_owner: &str, repo_name: &str) -> RepoConfig
Get configuration for a repository
Checks cache first, then fetches from GitHub if cache miss or expired. Returns default config if file is missing or invalid.
Sourcepub async fn invalidate_cache(&self, repo_owner: &str, repo_name: &str)
pub async fn invalidate_cache(&self, repo_owner: &str, repo_name: &str)
Clear cache for a specific repository
Sourcepub async fn clear_cache(&self)
pub async fn clear_cache(&self)
Clear all cached configs
Sourcepub async fn cache_size(&self) -> usize
pub async fn cache_size(&self) -> usize
Get cache statistics (for monitoring)
Auto Trait Implementations§
impl Freeze for RepoConfigLoader
impl !RefUnwindSafe for RepoConfigLoader
impl Send for RepoConfigLoader
impl Sync for RepoConfigLoader
impl Unpin for RepoConfigLoader
impl !UnwindSafe for RepoConfigLoader
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more