pub struct Client {
pub http: Arc<dyn Doer>,
pub network_scope: String,
pub rate_limiter: Option<Arc<GitHubRateLimiter>>,
pub registry_url: String,
pub user_agent: String,
pub auth: Vec<AuthConfig>,
pub resolved_auth: Vec<ResolvedAuthConfig>,
pub resolved_auth_expires_at: Option<SystemTime>,
/* private fields */
}Expand description
Go pluginstore.Client.
Fields§
§http: Arc<dyn Doer>§network_scope: StringDistinguishes request state for different proxy/egress configurations.
rate_limiter: Option<Arc<GitHubRateLimiter>>§registry_url: String§user_agent: String§auth: Vec<AuthConfig>§resolved_auth: Vec<ResolvedAuthConfig>§resolved_auth_expires_at: Option<SystemTime>Implementations§
Source§impl Client
impl Client
pub fn new(http: Arc<dyn Doer>) -> Self
Sourcepub async fn fetch_registry(&self) -> Result<Registry, StoreError>
pub async fn fetch_registry(&self) -> Result<Registry, StoreError>
Go FetchRegistry.
Sourcepub async fn fetch_latest_release(
&self,
plugin: &Plugin,
) -> Result<Release, StoreError>
pub async fn fetch_latest_release( &self, plugin: &Plugin, ) -> Result<Release, StoreError>
Go FetchLatestRelease.
Sourcepub async fn fetch_release_by_tag(
&self,
plugin: &Plugin,
tag: &str,
) -> Result<Release, StoreError>
pub async fn fetch_release_by_tag( &self, plugin: &Plugin, tag: &str, ) -> Result<Release, StoreError>
Go FetchReleaseByTag.
Sourcepub fn prepare_latest_release(
&self,
plugin: &Plugin,
) -> Result<(Client, String), StoreError>
pub fn prepare_latest_release( &self, plugin: &Plugin, ) -> Result<(Client, String), StoreError>
Go PrepareLatestRelease: binds the cache key and the first release request
to one credential snapshot.
Sourcepub fn latest_release_cache_key(
&self,
plugin: &Plugin,
) -> Result<String, StoreError>
pub fn latest_release_cache_key( &self, plugin: &Plugin, ) -> Result<String, StoreError>
Go LatestReleaseCacheKey.
Sourcepub async fn download_asset(
&self,
asset: &ReleaseAsset,
) -> Result<Bytes, StoreError>
pub async fn download_asset( &self, asset: &ReleaseAsset, ) -> Result<Bytes, StoreError>
Go DownloadAsset: the browser URL, or the API URL when there is none or
credentials apply to it.
Sourcepub async fn download_artifact(
&self,
artifact: &Artifact,
) -> Result<Bytes, StoreError>
pub async fn download_artifact( &self, artifact: &Artifact, ) -> Result<Bytes, StoreError>
Go DownloadArtifact: bounded by the declared size.
Source§impl Client
impl Client
Sourcepub async fn install(
&self,
plugin: Plugin,
options: InstallOptions,
) -> Result<InstallResult, StoreError>
pub async fn install( &self, plugin: Plugin, options: InstallOptions, ) -> Result<InstallResult, StoreError>
Go Install: a direct install’s plan, or the latest GitHub release.
Sourcepub async fn install_manifest(
&self,
manifest: &Manifest,
options: InstallOptions,
) -> Result<InstallResult, StoreError>
pub async fn install_manifest( &self, manifest: &Manifest, options: InstallOptions, ) -> Result<InstallResult, StoreError>
Go InstallManifest.
Sourcepub async fn install_version(
&self,
plugin: Plugin,
release_tag: &str,
version: &str,
options: InstallOptions,
) -> Result<InstallResult, StoreError>
pub async fn install_version( &self, plugin: Plugin, release_tag: &str, version: &str, options: InstallOptions, ) -> Result<InstallResult, StoreError>
Go InstallVersion: a fixed release tag and version.
Sourcepub async fn install_direct(
&self,
plugin: Plugin,
plan: InstallPlan,
options: InstallOptions,
) -> Result<InstallResult, StoreError>
pub async fn install_direct( &self, plugin: Plugin, plan: InstallPlan, options: InstallOptions, ) -> Result<InstallResult, StoreError>
Go InstallDirect.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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