Class: ContainerRegistry::BaseClient

Inherits:
Object
  • Object
show all
Defined in:
lib/container_registry/base_client.rb

Direct Known Subclasses

Client, GitlabApiClient

Constant Summary collapse

DOCKER_DISTRIBUTION_MANIFEST_V2_TYPE =
'application/vnd.docker.distribution.manifest.v2+json'
DOCKER_DISTRIBUTION_MANIFEST_LIST_V2_TYPE =
'application/vnd.docker.distribution.manifest.list.v2+json'
OCI_DISTRIBUTION_INDEX_TYPE =
'application/vnd.oci.image.index.v1+json'
OCI_MANIFEST_V1_TYPE =
'application/vnd.oci.image.manifest.v1+json'
CONTAINER_IMAGE_V1_TYPE =
'application/vnd.docker.container.image.v1+json'
ACCEPTED_TYPES =
[DOCKER_DISTRIBUTION_MANIFEST_V2_TYPE, OCI_MANIFEST_V1_TYPE].freeze
ACCEPTED_TYPES_RAW =
[DOCKER_DISTRIBUTION_MANIFEST_V2_TYPE, OCI_MANIFEST_V1_TYPE, DOCKER_DISTRIBUTION_MANIFEST_LIST_V2_TYPE, OCI_DISTRIBUTION_INDEX_TYPE].freeze
RETRY_EXCEPTIONS =
[Faraday::Request::Retry::DEFAULT_EXCEPTIONS, Faraday::ConnectionFailed].flatten.freeze
RETRY_OPTIONS =
{
  max: 1,
  interval: 5,
  exceptions: RETRY_EXCEPTIONS
}.freeze
ERROR_CALLBACK_OPTIONS =
{
  callback: -> (env, exception) do
    Gitlab::ErrorTracking.log_exception(
      exception,
      class: name,
      url: env[:url]
    )
  end
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(base_uri, options = {}) ⇒ BaseClient

Returns a new instance of BaseClient.


59
60
61
62
# File 'lib/container_registry/base_client.rb', line 59

def initialize(base_uri, options = {})
  @base_uri = base_uri
  @options = options
end