Skip to main content

torii_lib/platforms/sourcehut/
release.rs

1//! Sourcehut — release client.
2
3use crate::error::{Result, ToriiError};
4use crate::platforms::release::*;
5
6pub struct SourcehutReleaseClient;
7
8impl SourcehutReleaseClient {
9    pub fn new() -> Result<Self> {
10        Ok(Self)
11    }
12}
13
14fn srht_release_unsupported() -> ToriiError {
15    ToriiError::Unsupported(
16        "Sourcehut has no Release-page object. A release on sourcehut \
17         is just an annotated git tag (`torii tag create vX --release`); \
18         binaries live outside the host. If you want listed releases \
19         with notes + assets, mirror the project to GitLab/GitHub/Codeberg \
20         and use the platform's native release API there."
21            .to_string(),
22    )
23}
24
25impl ReleaseClient for SourcehutReleaseClient {
26    fn list(&self, _o: &str, _r: &str, _l: usize) -> Result<Vec<Release>> {
27        Err(srht_release_unsupported())
28    }
29    fn get(&self, _o: &str, _r: &str, _t: &str) -> Result<Release> {
30        Err(srht_release_unsupported())
31    }
32    fn edit(&self, _o: &str, _r: &str, _t: &str, _n: Option<&str>, _d: Option<&str>) -> Result<()> {
33        Err(srht_release_unsupported())
34    }
35    fn delete(&self, _o: &str, _r: &str, _t: &str) -> Result<()> {
36        Err(srht_release_unsupported())
37    }
38}
39
40// ============================================================================
41// Factory
42// ============================================================================
43
44// ============================================================================
45// Radicle (peer-to-peer, no native release object)
46// ============================================================================
47//
48// Radicle has no Release-page concept — same as Sourcehut. Annotated
49// tags travel via the gossip protocol; binary distribution happens off
50// the network (project's own website, IPFS, etc.).