class Zap::Commands::Install::RegistryClients
Overview
Exposes a pool of http(s) clients for each registry and convenience methods to access the pools.
The pools are lazily initialized and cached.
Defined in:
commands/install/registry_clients.crConstructors
-
.new(store_path : String, npmrc : Npmrc, *, pool_max_size : Int32 = 20, bypass_staleness_checks : Bool = false)
Initialize a new registry clients pool with the following arguments: - store_path: path to the store where the metadata will be cached - npmrc: the npmrc configuration, used for authentication and TLS options - pool_max_size: the maximum number of clients to keep in the pools - bypass_staleness_checks: whether to bypass the staleness checks when reading from the cache
Instance Method Summary
-
#find_or_init_pool(url : String) : Tuple(String, Utils::Fetch(Manifest))
Attempts to find a matching client pool for the given (tarball) url or creates a new one if it doesn't exist.
-
#get_or_init_pool(url : String) : Utils::Fetch(Manifest)
Returns the client pool for the given registry url or creates a new one if it doesn't exist.
Constructor Detail
Initialize a new registry clients pool with the following arguments:
- store_path: path to the store where the metadata will be cached
- npmrc: the npmrc configuration, used for authentication and TLS options
- pool_max_size: the maximum number of clients to keep in the pools
- bypass_staleness_checks: whether to bypass the staleness checks when reading from the cache
Instance Method Detail
Attempts to find a matching client pool for the given (tarball) url or creates a new one if it doesn't exist. Strips the path from the url before matching.
Returns the client pool for the given registry url or creates a new one if it doesn't exist.