pub struct GitHubSource { /* private fields */ }Expand description
Reads releases from a GitHub repository’s Releases.
Binary deltas (see the delta feature) are discovered by name: for the
selected asset <asset>, a release asset named <asset>.from-<version>.delta
is a delta from <version>. Its checksum is read from the same checksums
file and its signature from <asset>.from-<version>.delta.minisig (with the
configured suffix). Delta files are never picked as the main asset. With
delta_history, deltas attached to earlier releases
are listed too, so the engine can chain them.
use gpui_updater_core::GitHubSource;
let source = GitHubSource::new("AprilNEA", "OpenLogi")
.asset_contains("macos")
.asset_contains(".dmg")
.with_checksums("SHA256SUMS")
.with_minisig();Implementations§
Source§impl GitHubSource
impl GitHubSource
Sourcepub fn new(owner: impl Into<String>, repo: impl Into<String>) -> GitHubSource
pub fn new(owner: impl Into<String>, repo: impl Into<String>) -> GitHubSource
Create a source for owner/repo, matching assets by an extension
guessed from the current OS (.dmg / .exe / .tar.gz).
Sourcepub fn http(self, http: HttpOptions) -> GitHubSource
pub fn http(self, http: HttpOptions) -> GitHubSource
Fetch the release list and the checksums file with http’s extra headers and proxy.
Sourcepub fn asset_contains(self, substr: impl Into<String>) -> GitHubSource
pub fn asset_contains(self, substr: impl Into<String>) -> GitHubSource
Require the selected asset’s name to contain substr (case-insensitive).
Call multiple times to require several substrings (e.g. macos + arm64).
Sourcepub fn asset_patterns(self, patterns: Vec<String>) -> GitHubSource
pub fn asset_patterns(self, patterns: Vec<String>) -> GitHubSource
Replace the asset-matching substrings entirely.
Sourcepub fn with_checksums(self, sums_asset: impl Into<String>) -> GitHubSource
pub fn with_checksums(self, sums_asset: impl Into<String>) -> GitHubSource
Resolve the expected SHA-256 from a checksums file asset (one
<hex> <name> line per asset, as produced by shasum -a 256).
Sourcepub fn with_minisig(self) -> GitHubSource
pub fn with_minisig(self) -> GitHubSource
Look for a detached minisign signature named <asset>.minisig.
Sourcepub fn signature_suffix(self, suffix: impl Into<String>) -> GitHubSource
pub fn signature_suffix(self, suffix: impl Into<String>) -> GitHubSource
Use a custom signature suffix instead of .minisig.
Sourcepub fn include_prereleases(self, yes: bool) -> GitHubSource
pub fn include_prereleases(self, yes: bool) -> GitHubSource
Consider pre-releases in addition to full releases.
Sourcepub fn token(self, token: impl Into<String>) -> GitHubSource
pub fn token(self, token: impl Into<String>) -> GitHubSource
Authenticate requests with a token (private repos / rate limits).
Sourcepub fn delta_history(self, releases: usize) -> GitHubSource
pub fn delta_history(self, releases: usize) -> GitHubSource
Also read the deltas attached to up to releases earlier releases, so
the engine can chain them when no delta starts at the installed version
(publish them with delta::delta_bases). This lists releases instead
of asking for /releases/latest: still one API request, covering up
to 100 releases.
Trait Implementations§
Source§impl UpdateSource for GitHubSource
impl UpdateSource for GitHubSource
Auto Trait Implementations§
impl Freeze for GitHubSource
impl RefUnwindSafe for GitHubSource
impl Send for GitHubSource
impl Sync for GitHubSource
impl Unpin for GitHubSource
impl UnsafeUnpin for GitHubSource
impl UnwindSafe for GitHubSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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