Move names regular expressions to api/v2 packages
Because the repository name definitions are part of the v2 specification, they have been moved out of the common package. This is part of the effort to break up the common package into more sensible components. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
8be20212f1
commit
d88884c51c
@ -4,7 +4,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/docker/distribution/common"
|
|
||||||
"github.com/docker/distribution/digest"
|
"github.com/docker/distribution/digest"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -12,7 +11,7 @@ var (
|
|||||||
nameParameterDescriptor = ParameterDescriptor{
|
nameParameterDescriptor = ParameterDescriptor{
|
||||||
Name: "name",
|
Name: "name",
|
||||||
Type: "string",
|
Type: "string",
|
||||||
Format: common.RepositoryNameRegexp.String(),
|
Format: RepositoryNameRegexp.String(),
|
||||||
Required: true,
|
Required: true,
|
||||||
Description: `Name of the target repository.`,
|
Description: `Name of the target repository.`,
|
||||||
}
|
}
|
||||||
@ -20,7 +19,7 @@ var (
|
|||||||
tagParameterDescriptor = ParameterDescriptor{
|
tagParameterDescriptor = ParameterDescriptor{
|
||||||
Name: "tag",
|
Name: "tag",
|
||||||
Type: "string",
|
Type: "string",
|
||||||
Format: common.TagNameRegexp.String(),
|
Format: TagNameRegexp.String(),
|
||||||
Required: true,
|
Required: true,
|
||||||
Description: `Tag of the target manifiest.`,
|
Description: `Tag of the target manifiest.`,
|
||||||
}
|
}
|
||||||
@ -307,7 +306,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: RouteNameTags,
|
Name: RouteNameTags,
|
||||||
Path: "/v2/{name:" + common.RepositoryNameRegexp.String() + "}/tags/list",
|
Path: "/v2/{name:" + RepositoryNameRegexp.String() + "}/tags/list",
|
||||||
Entity: "Tags",
|
Entity: "Tags",
|
||||||
Description: "Retrieve information about tags.",
|
Description: "Retrieve information about tags.",
|
||||||
Methods: []MethodDescriptor{
|
Methods: []MethodDescriptor{
|
||||||
@ -352,7 +351,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: RouteNameManifest,
|
Name: RouteNameManifest,
|
||||||
Path: "/v2/{name:" + common.RepositoryNameRegexp.String() + "}/manifests/{tag:" + common.TagNameRegexp.String() + "}",
|
Path: "/v2/{name:" + RepositoryNameRegexp.String() + "}/manifests/{tag:" + TagNameRegexp.String() + "}",
|
||||||
Entity: "Manifest",
|
Entity: "Manifest",
|
||||||
Description: "Create, update and retrieve manifests.",
|
Description: "Create, update and retrieve manifests.",
|
||||||
Methods: []MethodDescriptor{
|
Methods: []MethodDescriptor{
|
||||||
@ -514,7 +513,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||||||
|
|
||||||
{
|
{
|
||||||
Name: RouteNameBlob,
|
Name: RouteNameBlob,
|
||||||
Path: "/v2/{name:" + common.RepositoryNameRegexp.String() + "}/blobs/{digest:" + digest.DigestRegexp.String() + "}",
|
Path: "/v2/{name:" + RepositoryNameRegexp.String() + "}/blobs/{digest:" + digest.DigestRegexp.String() + "}",
|
||||||
Entity: "Blob",
|
Entity: "Blob",
|
||||||
Description: "Fetch the blob identified by `name` and `digest`. Used to fetch layers by tarsum digest.",
|
Description: "Fetch the blob identified by `name` and `digest`. Used to fetch layers by tarsum digest.",
|
||||||
Methods: []MethodDescriptor{
|
Methods: []MethodDescriptor{
|
||||||
@ -592,7 +591,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||||||
|
|
||||||
{
|
{
|
||||||
Name: RouteNameBlobUpload,
|
Name: RouteNameBlobUpload,
|
||||||
Path: "/v2/{name:" + common.RepositoryNameRegexp.String() + "}/blobs/uploads/",
|
Path: "/v2/{name:" + RepositoryNameRegexp.String() + "}/blobs/uploads/",
|
||||||
Entity: "Intiate Blob Upload",
|
Entity: "Intiate Blob Upload",
|
||||||
Description: "Initiate a blob upload. This endpoint can be used to create resumable uploads or monolithic uploads.",
|
Description: "Initiate a blob upload. This endpoint can be used to create resumable uploads or monolithic uploads.",
|
||||||
Methods: []MethodDescriptor{
|
Methods: []MethodDescriptor{
|
||||||
@ -700,7 +699,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||||||
|
|
||||||
{
|
{
|
||||||
Name: RouteNameBlobUploadChunk,
|
Name: RouteNameBlobUploadChunk,
|
||||||
Path: "/v2/{name:" + common.RepositoryNameRegexp.String() + "}/blobs/uploads/{uuid}",
|
Path: "/v2/{name:" + RepositoryNameRegexp.String() + "}/blobs/uploads/{uuid}",
|
||||||
Entity: "Blob Upload",
|
Entity: "Blob Upload",
|
||||||
Description: "Interact with blob uploads. Clients should never assemble URLs for this endpoint and should only take it through the `Location` header on related API requests.",
|
Description: "Interact with blob uploads. Clients should never assemble URLs for this endpoint and should only take it through the `Location` header on related API requests.",
|
||||||
Methods: []MethodDescriptor{
|
Methods: []MethodDescriptor{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package v2
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,4 +1,4 @@
|
|||||||
package common
|
package v2
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
Loading…
Reference in New Issue
Block a user