initial skeleton

This commit is contained in:
stoorps 2026-03-19 18:46:50 +00:00
parent dc79fa2448
commit 71f89dde9c
Signed by: stoorps
SSH key fingerprint: SHA256:AZlPfu9hTu042EGtZElmDQoy+KvMOeShLDan/fYLoNI
60 changed files with 3480 additions and 0 deletions

View file

@ -0,0 +1,50 @@
use crate::adapters::traits::{AdapterCapabilities, AdapterResolution, SourceAdapter};
use crate::domain::source::{ResolvedRelease, SourceKind, SourceRef};
pub struct GitHubAdapter;
impl Default for GitHubAdapter {
fn default() -> Self {
Self::new()
}
}
impl GitHubAdapter {
pub fn new() -> Self {
Self
}
pub fn resolve(&self, source: &SourceRef) -> Result<AdapterResolution, GitHubAdapterError> {
if source.kind != SourceKind::GitHub {
return Err(GitHubAdapterError::UnsupportedSource);
}
Ok(AdapterResolution {
source: SourceRef {
kind: SourceKind::GitHub,
locator: source.locator.clone(),
},
release: ResolvedRelease {
version: "latest".to_owned(),
},
})
}
}
impl SourceAdapter for GitHubAdapter {
fn id(&self) -> &'static str {
"github"
}
fn capabilities(&self) -> AdapterCapabilities {
AdapterCapabilities {
supports_search: true,
supports_exact_resolution: true,
}
}
}
#[derive(Debug, Eq, PartialEq)]
pub enum GitHubAdapterError {
UnsupportedSource,
}