class Tagfish::DockerRegistryV1Client

Public Instance Methods

api_version() click to toggle source
# File lib/tagfish/docker_registry_v1_client.rb, line 6
def api_version
  'v1'
end
tag_names() click to toggle source
# File lib/tagfish/docker_registry_v1_client.rb, line 10
def tag_names
  tags.tag_names
end
tags() click to toggle source
# File lib/tagfish/docker_registry_v1_client.rb, line 14
def tags
  tags_list = tags_api(tags_json)
  Tagfish::Tags.new(tags_list)
end

Private Instance Methods

ping_uri() click to toggle source
# File lib/tagfish/docker_registry_v1_client.rb, line 38
def ping_uri
  "#{base_uri}/v1/_ping"
end
tags_api(api_response_data) click to toggle source
# File lib/tagfish/docker_registry_v1_client.rb, line 25
def tags_api(api_response_data)
  case api_response_data
  when Hash
    api_response_data
  when Array
    api_response_data.reduce({}) do |images, tag|
      images.merge({tag["name"] => tag["layer"]})
  end
  else
    raise "unexpected type #{api_response_data.class}"
  end
end
tags_json() click to toggle source
# File lib/tagfish/docker_registry_v1_client.rb, line 21
def tags_json
  api_call.get!(tags_uri).json
end
tags_uri() click to toggle source
# File lib/tagfish/docker_registry_v1_client.rb, line 42
def tags_uri
  "#{base_uri}/v1/repositories/#{docker_uri.repository}/tags"
end