From 5abfc91021077f522f2aa9f3b5f9b2ea3d903980 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Thu, 11 Dec 2014 22:10:18 -0800 Subject: [PATCH] Merge errors and urls package into unified v2 package To provide a single package with v2 API definitions, the locked down portions of the API have been merged into a single package. References to exported items will appear as v2.XXX, indicating their origin. The definitions in this package will soon be locked down for change, acceppting only additions that will not change protocol behavior. --- api/{errors => v2}/descriptors.go | 2 +- api/v2/doc.go | 9 +++++++++ api/{errors => v2}/errors.go | 10 +--------- api/{errors => v2}/errors_test.go | 2 +- api/{urls => v2}/routes.go | 2 +- api/{urls => v2}/routes_test.go | 2 +- api/{urls => v2}/urls.go | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) rename api/{errors => v2}/descriptors.go (99%) create mode 100644 api/v2/doc.go rename api/{errors => v2}/errors.go (91%) rename api/{errors => v2}/errors_test.go (99%) rename api/{urls => v2}/routes.go (99%) rename api/{urls => v2}/routes_test.go (99%) rename api/{urls => v2}/urls.go (99%) diff --git a/api/errors/descriptors.go b/api/v2/descriptors.go similarity index 99% rename from api/errors/descriptors.go rename to api/v2/descriptors.go index d2f0f7da9..77528d723 100644 --- a/api/errors/descriptors.go +++ b/api/v2/descriptors.go @@ -1,4 +1,4 @@ -package errors +package v2 import "net/http" diff --git a/api/v2/doc.go b/api/v2/doc.go new file mode 100644 index 000000000..cde011959 --- /dev/null +++ b/api/v2/doc.go @@ -0,0 +1,9 @@ +// Package v2 describes routes, urls and the error codes used in the Docker +// Registry JSON HTTP API V2. In addition to declarations, descriptors are +// provided for routes and error codes that can be used for implementation and +// automatically generating documentation. +// +// Definitions here are considered to be locked down for the V2 registry api. +// Any changes must be considered carefully and should not proceed without a +// change proposal in docker core. +package v2 diff --git a/api/errors/errors.go b/api/v2/errors.go similarity index 91% rename from api/errors/errors.go rename to api/v2/errors.go index b6e64e2a8..8c85d3a97 100644 --- a/api/errors/errors.go +++ b/api/v2/errors.go @@ -1,12 +1,4 @@ -// Package errors describes the error codes that may be returned via the -// Docker Registry JSON HTTP API V2. In addition to declaractions, -// descriptions about the error codes and the conditions causing them are -// avialable in detail. -// -// Error definitions here are considered to be locked down for the V2 registry -// api. Any changes must be considered carefully and should not proceed -// without a change proposal in docker core. -package errors +package v2 import ( "fmt" diff --git a/api/errors/errors_test.go b/api/v2/errors_test.go similarity index 99% rename from api/errors/errors_test.go rename to api/v2/errors_test.go index 2f5c69e04..d2fc091ac 100644 --- a/api/errors/errors_test.go +++ b/api/v2/errors_test.go @@ -1,4 +1,4 @@ -package errors +package v2 import ( "encoding/json" diff --git a/api/urls/routes.go b/api/v2/routes.go similarity index 99% rename from api/urls/routes.go rename to api/v2/routes.go index 79138a4a3..7ebe61d66 100644 --- a/api/urls/routes.go +++ b/api/v2/routes.go @@ -1,4 +1,4 @@ -package urls +package v2 import ( "github.com/docker/docker-registry/common" diff --git a/api/urls/routes_test.go b/api/v2/routes_test.go similarity index 99% rename from api/urls/routes_test.go rename to api/v2/routes_test.go index f2e95270c..9969ebcc4 100644 --- a/api/urls/routes_test.go +++ b/api/v2/routes_test.go @@ -1,4 +1,4 @@ -package urls +package v2 import ( "encoding/json" diff --git a/api/urls/urls.go b/api/v2/urls.go similarity index 99% rename from api/urls/urls.go rename to api/v2/urls.go index 86306c67b..15d654846 100644 --- a/api/urls/urls.go +++ b/api/v2/urls.go @@ -1,4 +1,4 @@ -package urls +package v2 import ( "net/http"