use http consts for request methods

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2022-11-02 23:31:23 +01:00
parent 7f9f86c411
commit f9ccd2c6ea
33 changed files with 211 additions and 211 deletions

View File

@@ -381,7 +381,7 @@ var routeDescriptors = []RouteDescriptor{
Description: `Base V2 API route. Typically, this can be used for lightweight version checks and to validate registry authentication.`,
Methods: []MethodDescriptor{
{
Method: "GET",
Method: http.MethodGet,
Description: "Check that the endpoint implements Docker Registry API V2.",
Requests: []RequestDescriptor{
{
@@ -415,7 +415,7 @@ var routeDescriptors = []RouteDescriptor{
Description: "Retrieve information about tags.",
Methods: []MethodDescriptor{
{
Method: "GET",
Method: http.MethodGet,
Description: "Fetch the tags under the repository identified by `name`.",
Requests: []RequestDescriptor{
{
@@ -519,7 +519,7 @@ var routeDescriptors = []RouteDescriptor{
Description: "Create, update, delete and retrieve manifests.",
Methods: []MethodDescriptor{
{
Method: "GET",
Method: http.MethodGet,
Description: "Fetch the manifest identified by `name` and `reference` where `reference` can be a tag or digest. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data.",
Requests: []RequestDescriptor{
{
@@ -566,7 +566,7 @@ var routeDescriptors = []RouteDescriptor{
},
},
{
Method: "PUT",
Method: http.MethodPut,
Description: "Put the manifest identified by `name` and `reference` where `reference` can be a tag or digest.",
Requests: []RequestDescriptor{
{
@@ -654,7 +654,7 @@ var routeDescriptors = []RouteDescriptor{
},
},
{
Method: "DELETE",
Method: http.MethodDelete,
Description: "Delete the manifest or tag identified by `name` and `reference` where `reference` can be a tag or digest. Note that a manifest can _only_ be deleted by digest.",
Requests: []RequestDescriptor{
{
@@ -724,7 +724,7 @@ var routeDescriptors = []RouteDescriptor{
Description: "Operations on blobs identified by `name` and `digest`. Used to fetch or delete layers by digest.",
Methods: []MethodDescriptor{
{
Method: "GET",
Method: http.MethodGet,
Description: "Retrieve the blob from the registry identified by `digest`. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data.",
Requests: []RequestDescriptor{
{
@@ -878,7 +878,7 @@ var routeDescriptors = []RouteDescriptor{
},
},
{
Method: "DELETE",
Method: http.MethodDelete,
Description: "Delete the blob identified by `name` and `digest`",
Requests: []RequestDescriptor{
{
@@ -958,7 +958,7 @@ var routeDescriptors = []RouteDescriptor{
Description: "Initiate a blob upload. This endpoint can be used to create resumable uploads or monolithic uploads.",
Methods: []MethodDescriptor{
{
Method: "POST",
Method: http.MethodPost,
Description: "Initiate a resumable blob upload. If successful, an upload location will be provided to complete the upload. Optionally, if the `digest` parameter is present, the request body will be used to complete the upload in a single request.",
Requests: []RequestDescriptor{
{
@@ -1151,7 +1151,7 @@ var routeDescriptors = []RouteDescriptor{
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. The `Location` header and its parameters should be preserved by clients, using the latest value returned via upload related API calls.",
Methods: []MethodDescriptor{
{
Method: "GET",
Method: http.MethodGet,
Description: "Retrieve status of upload identified by `uuid`. The primary purpose of this endpoint is to resolve the current status of a resumable upload.",
Requests: []RequestDescriptor{
{
@@ -1215,7 +1215,7 @@ var routeDescriptors = []RouteDescriptor{
},
},
{
Method: "PATCH",
Method: http.MethodPatch,
Description: "Upload a chunk of data for the specified upload.",
Requests: []RequestDescriptor{
{
@@ -1376,7 +1376,7 @@ var routeDescriptors = []RouteDescriptor{
},
},
{
Method: "PUT",
Method: http.MethodPut,
Description: "Complete the upload specified by `uuid`, optionally appending the body as the final chunk.",
Requests: []RequestDescriptor{
{
@@ -1467,7 +1467,7 @@ var routeDescriptors = []RouteDescriptor{
},
},
{
Method: "DELETE",
Method: http.MethodDelete,
Description: "Cancel outstanding upload processes, releasing associated resources. If this is not called, the unfinished uploads will eventually timeout.",
Requests: []RequestDescriptor{
{
@@ -1532,7 +1532,7 @@ var routeDescriptors = []RouteDescriptor{
Description: "List a set of available repositories in the local registry cluster. Does not provide any indication of what may be available upstream. Applications can only determine if a repository is available but not if it is not available.",
Methods: []MethodDescriptor{
{
Method: "GET",
Method: http.MethodGet,
Description: "Retrieve a sorted, json list of repositories available in the registry.",
Requests: []RequestDescriptor{
{