Prepare for reminding

This commit is contained in:
Rahix 2026-03-02 08:46:52 +01:00
parent c1c0ced266
commit aebbcd7815
5 changed files with 124 additions and 5 deletions

View file

@ -13,6 +13,9 @@ pub struct Context {
pub repo_url: url::Url,
/// URL of the repository with authentication information attached
pub repo_auth_url: url::Url,
/// Timestamp "now" to be used in comparisons
pub timestamp: jiff::Zoned,
}
impl Context {
@ -67,12 +70,15 @@ impl Context {
let forgejo = forgejo_api::Forgejo::new(forgejo_api::Auth::Token(token), server_url)
.context("Could not create Forgejo API access object")?;
let timestamp = jiff::Zoned::now();
Ok(Self {
forgejo,
owner: owner.to_owned(),
repo: repo.to_owned(),
repo_url,
repo_auth_url,
timestamp,
})
}
}