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.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

or(other : T) : T | self forall T or, pipe(&) pipe

Constructor Detail

def self.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

[View source]

Instance Method Detail

def 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. Strips the path from the url before matching.


[View source]
def 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.


[View source]