pub struct CacheClientBuilder {Show 15 fields
pub base_url: String,
pub token: String,
pub user_agent: String,
pub cache_to: Option<String>,
pub cache_from: Vec<String>,
pub max_retries: u32,
pub min_retry_interval: Duration,
pub max_retry_interval: Duration,
pub backoff_factor_base: u32,
pub download_chunk_size: u64,
pub download_chunk_timeout: Duration,
pub download_concurrency: u32,
pub upload_chunk_size: u64,
pub upload_chunk_timeout: Duration,
pub upload_concurrency: u32,
}
Expand description
GitHub Actions cache client builder.
See module documentation.
Fields§
§base_url: String
GitHub Actions cache API base URL.
token: String
GitHub Actions access token.
user_agent: String
User agent for HTTP requests.
cache_to: Option<String>
Cache key to write.
cache_from: Vec<String>
Cache key prefixes to read.
max_retries: u32
Maximum number of retries.
min_retry_interval: Duration
Minimum retry interval. See ExponentialBackoff::min_retry_interval
.
max_retry_interval: Duration
Maximum retry interval. See ExponentialBackoff::max_retry_interval
.
backoff_factor_base: u32
Retry backoff factor base. See ExponentialBackoff::backoff_exponent
.
download_chunk_size: u64
Maximum chunk size in bytes for downloads.
download_chunk_timeout: Duration
Maximum time for each chunk download request.
download_concurrency: u32
Number of parallel downloads.
upload_chunk_size: u64
Maximum chunk size in bytes for uploads.
upload_chunk_timeout: Duration
Maximum time for each chunk upload request.
upload_concurrency: u32
Number of parallel uploads.
Implementations§
Source§impl CacheClientBuilder
impl CacheClientBuilder
Sourcepub fn new<B: Into<String>, T: Into<String>>(base_url: B, token: T) -> Self
pub fn new<B: Into<String>, T: Into<String>>(base_url: B, token: T) -> Self
Creates a new CacheClientBuilder
for the given GitHub Actions cache
API base URL and access token.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Creates a new CacheClientBuilder
from GitHub Actions cache
environmental variables.
The following environmental variables are read:
ACTIONS_CACHE_URL
- GitHub Actions cache API base URLACTIONS_RUNTIME_TOKEN
- GitHub Actions access tokenSEGMENT_DOWNLOAD_TIMEOUT_MINS
- download chunk timeout
Sourcepub fn base_url<T: Into<String>>(self, base_url: T) -> Self
pub fn base_url<T: Into<String>>(self, base_url: T) -> Self
Sets the GitHub Actions cache API base URL.
Sourcepub fn user_agent<T: Into<String>>(self, user_agent: T) -> Self
pub fn user_agent<T: Into<String>>(self, user_agent: T) -> Self
Sets the user agent for HTTP requests.
Sourcepub fn cache_from<T>(self, cache_from: T) -> Self
pub fn cache_from<T>(self, cache_from: T) -> Self
Sets the cache key prefixes to read.
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Sets the maximum number of retries.
Sourcepub fn min_retry_interval(self, min_retry_interval: Duration) -> Self
pub fn min_retry_interval(self, min_retry_interval: Duration) -> Self
Sets the minimum retry interval.
Sourcepub fn max_retry_interval(self, max_retry_interval: Duration) -> Self
pub fn max_retry_interval(self, max_retry_interval: Duration) -> Self
Sets the maximum retry interval.
Sourcepub fn backoff_factor_base(self, backoff_factor_base: u32) -> Self
pub fn backoff_factor_base(self, backoff_factor_base: u32) -> Self
Sets the retry backoff factor base.
Sourcepub fn download_chunk_size(self, download_chunk_size: u64) -> Self
pub fn download_chunk_size(self, download_chunk_size: u64) -> Self
Maximum chunk size in bytes for downloads.
Sourcepub fn download_chunk_timeout(self, download_chunk_timeout: Duration) -> Self
pub fn download_chunk_timeout(self, download_chunk_timeout: Duration) -> Self
Sets the maximum time for each chunk download request.
Sourcepub fn download_concurrency(self, download_concurrency: u32) -> Self
pub fn download_concurrency(self, download_concurrency: u32) -> Self
Sets the number of parallel downloads.
Sourcepub fn upload_chunk_size(self, upload_chunk_size: u64) -> Self
pub fn upload_chunk_size(self, upload_chunk_size: u64) -> Self
Sets the maximum chunk size in bytes for uploads.
Sourcepub fn upload_chunk_timeout(self, upload_chunk_timeout: Duration) -> Self
pub fn upload_chunk_timeout(self, upload_chunk_timeout: Duration) -> Self
Sets the maximum time for each chunk upload request.
Sourcepub fn upload_concurrency(self, upload_concurrency: u32) -> Self
pub fn upload_concurrency(self, upload_concurrency: u32) -> Self
Sets the number of parallel downloads.
Sourcepub fn build(self) -> Result<CacheClient>
pub fn build(self) -> Result<CacheClient>
Consumes this CacheClientBuilder
and build a CacheClient
.
Trait Implementations§
Source§impl Clone for CacheClientBuilder
impl Clone for CacheClientBuilder
Source§fn clone(&self) -> CacheClientBuilder
fn clone(&self) -> CacheClientBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CacheClientBuilder
impl Debug for CacheClientBuilder
Source§impl Default for CacheClientBuilder
impl Default for CacheClientBuilder
Source§impl PartialEq for CacheClientBuilder
impl PartialEq for CacheClientBuilder
Source§impl TryInto<CacheClient> for CacheClientBuilder
impl TryInto<CacheClient> for CacheClientBuilder
impl Eq for CacheClientBuilder
impl StructuralPartialEq for CacheClientBuilder
Auto Trait Implementations§
impl Freeze for CacheClientBuilder
impl RefUnwindSafe for CacheClientBuilder
impl Send for CacheClientBuilder
impl Sync for CacheClientBuilder
impl Unpin for CacheClientBuilder
impl UnwindSafe for CacheClientBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.