class Tagfish::DockerRegistryV2Client

Public Instance Methods

api_version() click to toggle source
# File lib/tagfish/docker_registry_v2_client.rb, line 6
def api_version
  'v2'
end
tag_names() click to toggle source
# File lib/tagfish/docker_registry_v2_client.rb, line 10
def tag_names
  tags_json["tags"]
end
tags() click to toggle source
# File lib/tagfish/docker_registry_v2_client.rb, line 14
def tags
  Tagfish::Tags.new(tags_list)
end

Private Instance Methods

hash(tag) click to toggle source
# File lib/tagfish/docker_registry_v2_client.rb, line 24
def hash(tag)
  api_call.get!(hash_uri(tag)).json
end
hash_uri(tag) click to toggle source
# File lib/tagfish/docker_registry_v2_client.rb, line 47
def hash_uri(tag)
  "#{base_uri}/v2/#{docker_uri.repository}/manifests/#{tag}"
end
ping_uri() click to toggle source
# File lib/tagfish/docker_registry_v2_client.rb, line 39
def ping_uri
  "#{base_uri}/v2/"
end
tags_json() click to toggle source
# File lib/tagfish/docker_registry_v2_client.rb, line 20
def tags_json
  api_call.get!(tags_uri).json
end
tags_list() click to toggle source
# File lib/tagfish/docker_registry_v2_client.rb, line 28
def tags_list
  if tag_names.nil?
    abort("No Tags found for this repository")
  end

  tags_with_hashes = tag_names.inject({}) do |dict, tag|
    dict[tag] = hash(tag)["fsLayers"]
    dict
  end
end
tags_uri() click to toggle source
# File lib/tagfish/docker_registry_v2_client.rb, line 43
def tags_uri
  "#{base_uri}/v2/#{docker_uri.repository}/tags/list"
end