Saltar al contenido principal

GiteaSource class

Namespace: Velopack.Sources

Retrieves available releases from a Gitea repository.

public class GiteaSource : GitBase<GiteaRelease>, IUpdateSource

Inherits: GitBase<GiteaRelease>
Implements: IUpdateSource

Constructors

ConstructorSummary
GiteaSourceRetrieves available releases from a Gitea repository.

GiteaSource(repoUrl, accessToken, prerelease, downloader)

public GiteaSource(string repoUrl, string? accessToken, bool prerelease, IFileDownloader? downloader = null)

Retrieves available releases from a Gitea repository.

Parameters

NameTypeDescription
repoUrlstringThe URL of the Gitea repository to download releases from
(e.g. https://Gitea.com/myuser/myrepo)
accessTokenstringThe Gitea access token to use with the request to download releases.
If left empty, the Gitea rate limit for unauthenticated requests allows
for up to 60 requests per hour, limited by IP address.
prereleaseboolIf true, pre-releases will be also be searched / downloaded. If false, only
stable releases will be considered.
downloaderIFileDownloaderThe file downloader used to perform HTTP requests.

Properties

PropertySummary
Authorization

Authorization

protected override (string Name, string Value)? Authorization { get; }

Methods

MethodSummary
GetReleasesRetrieves a list of GithubRelease from the current repository.
GetAssetUrlFromNameGiven a GithubRelease and an asset filename (eg. 'RELEASES') this
GetApiBaseUrlGiven a repository URL (e.g. https://Gitea.com/myuser/myrepo) this function

GetReleases(includePrereleases)

protected override Task<GiteaRelease[]> GetReleases(bool includePrereleases)

Retrieves a list of GithubRelease from the current repository.

Parameters

NameTypeDescription
includePrereleasesbool

Returns Task<GiteaRelease[]>

GetAssetUrlFromName(release, assetName)

protected override string GetAssetUrlFromName(GiteaRelease release, string assetName)

Given a GithubRelease and an asset filename (eg. 'RELEASES') this function will return either BrowserDownloadUrl or Url, depending whether an access token is available or not. Throws if the specified release has no matching assets.

Parameters

NameTypeDescription
releaseGiteaRelease
assetNamestring

Returns string

GetApiBaseUrl(repoUrl)

protected virtual Uri GetApiBaseUrl(Uri repoUrl)

Given a repository URL (e.g. https://Gitea.com/myuser/myrepo) this function returns the API base for performing requests. (eg. "https://api.Gitea.com/" or http://internal.Gitea.server.local/api/v1) or http://localhost:3000/api/v1

Parameters

NameTypeDescription
repoUrlUri

Returns Uri


Generated from Velopack 1.1.1