SimpleWebSource class
Namespace: Velopack.Sources
Retrieves updates from a static file host or other web server. Will perform a request for '{baseUri}/RELEASES' to locate the available packages, and provides query parameters to specify the name of the requested package.
public class SimpleWebSource : IUpdateSource
Implements: IUpdateSource
Constructors
| Constructor | Summary |
|---|---|
SimpleWebSource | Retrieves updates from a static file host or other web server. |
SimpleWebSource | Retrieves updates from a static file host or other web server. |
SimpleWebSource(baseUrl, downloader, timeout)
public SimpleWebSource(string baseUrl, IFileDownloader? downloader = null, double timeout = 30)
Retrieves updates from a static file host or other web server. Will perform a request for '{baseUri}/RELEASES' to locate the available packages, and provides query parameters to specify the name of the requested package.
Parameters
| Name | Type | Description |
|---|---|---|
baseUrl | string | |
downloader | IFileDownloader | |
timeout | double |
SimpleWebSource(baseUri, downloader, timeout)
public SimpleWebSource(Uri baseUri, IFileDownloader? downloader = null, double timeout = 30)
Retrieves updates from a static file host or other web server. Will perform a request for '{baseUri}/RELEASES' to locate the available packages, and provides query parameters to specify the name of the requested package.
Parameters
| Name | Type | Description |
|---|---|---|
baseUri | Uri | |
downloader | IFileDownloader | |
timeout | double |
Properties
| Property | Summary |
|---|---|
Timeout | The timeout for http requests, in minutes. |
BaseUri | The URL of the server hosting packages to update to. |
Downloader | The IFileDownloader to be used for performing http requests. |
Timeout
public double Timeout { get; set; }
The timeout for http requests, in minutes.
BaseUri
public virtual Uri BaseUri { get; }
The URL of the server hosting packages to update to.
Downloader
public virtual IFileDownloader Downloader { get; }
The IFileDownloader to be used for performing http requests.
Methods
| Method | Summary |
|---|---|
GetReleaseFeed | Retrieve the list of available remote releases from the package source. These releases |
DownloadReleaseEntry | Download the specified VelopackAsset to the provided local file path. |
GetReleaseFeed(logger, appId, channel, stagingId, latestLocalRelease)
public virtual Task<VelopackAssetFeed> GetReleaseFeed(IVelopackLogger logger, string? appId, string channel, Guid? stagingId = null, VelopackAsset? latestLocalRelease = null)
Retrieve the list of available remote releases from the package source. These releases
can subsequently be downloaded with DownloadReleaseEntry.
Parameters
| Name | Type | Description |
|---|---|---|
logger | IVelopackLogger | The logger to use for any diagnostic messages. |
appId | string | |
channel | string | Release channel to filter packages by. Can be null, which is the default channel for this operating system. |
stagingId | Guid? | A persistent user-id, used for calculating whether a specific release should be available to this user or not. (eg, for the purposes of rolling out an update to only a small portion of users at a time). |
latestLocalRelease | VelopackAsset | The latest / current local release. If specified, metadata from this package may be provided to the remote server (such as package id, or cpu architecture) to ensure that the correct package is downloaded for this user. |
Returns Task<VelopackAssetFeed> — An array of VelopackAsset objects that are available for download
and are applicable to this user.
DownloadReleaseEntry(logger, releaseEntry, localFile, progress, cancelToken)
public virtual Task DownloadReleaseEntry(IVelopackLogger logger, VelopackAsset releaseEntry, string localFile, Action<int> progress, CancellationToken cancelToken)
Download the specified VelopackAsset to the provided local file path.
Parameters
| Name | Type | Description |
|---|---|---|
logger | IVelopackLogger | The logger to use for any diagnostic messages. |
releaseEntry | VelopackAsset | The release to download. |
localFile | string | The path on the local disk to store the file. If this file exists, it will be overwritten. |
progress | Action<int> | This delegate will be executed with values from 0-100 as the download is being processed. |
cancelToken | CancellationToken | A token to use to cancel the request. |
Returns Task
Generated from Velopack 1.1.1