working commit

This commit is contained in:
2026-02-05 17:49:31 +02:00
parent 8dce641498
commit fcd7d50d75
11 changed files with 49 additions and 41 deletions
+1 -7
View File
@@ -21,7 +21,6 @@ func (hand *Handler) BlobExists(rctx *router.Context) {
name, _ := rctx.GetSubpath("name")
digest, _ := rctx.GetSubpath("digest")
hand.logg.Debugf("Handle BlobExists with name=[%s] digest=[%s]", name, digest)
params := &operator.BlobExistsParams{
Name: name,
Digest: digest,
@@ -40,11 +39,11 @@ func (hand *Handler) BlobExists(rctx *router.Context) {
// POST /v2/<name>/blobs/uploads/ 202 404
func (hand *Handler) PostUpload(rctx *router.Context) {
name, _ := rctx.GetSubpath("name")
digest := rctx.GetQuery("digest")
mount := rctx.GetQuery("mount")
from := rctx.GetQuery("from")
hand.logg.Debugf("Handle PostUpload with name=[%s] digest=[%s]", name, digest)
params := &operator.PostUploadParams{
Name: name,
Digest: digest,
@@ -55,7 +54,6 @@ func (hand *Handler) PostUpload(rctx *router.Context) {
if err != nil {
hand.logg.Errorf("PostUpload error: %v", err)
} else {
hand.logg.Debugf("PostUpload send location=[%s] code=%d", res.Location, code)
rctx.SetHeader("Location", res.Location)
rctx.SetHeader("Content-Length", res.ContentLength)
rctx.SetHeader("Docker-Upload-UUID", res.DockerUploadUUID)
@@ -69,8 +67,6 @@ func (hand *Handler) PostUpload(rctx *router.Context) {
// PATCH /v2/<name>/blobs/uploads/<reference> 202 404/416
func (hand *Handler) PatchUpload(rctx *router.Context) {
//hand.DumpHeaders("PatchUpload headers", rctx)
contentLength := rctx.GetHeader("Content-Length")
contentType := rctx.GetHeader("Content-Type")
contentRange := rctx.GetHeader("Content-Range")
@@ -102,8 +98,6 @@ func (hand *Handler) PatchUpload(rctx *router.Context) {
// PUT /v2/<name>/uploads/<reference>?digest=<digest> 202 404/416
func (hand *Handler) PutUpload(rctx *router.Context) {
//hand.DumpHeaders("PutUpload headers", rctx)
contentType := rctx.GetHeader("Content-Type")
contentLength := rctx.GetHeader("Content-Length")
contentRange := rctx.GetHeader("Content-Range")
+5 -15
View File
@@ -10,9 +10,8 @@ import (
const zeroContentLength = "0"
func (hand *Handler) FileExists(rctx *router.Context) {
hand.logg.Debugf("Handle FileExists")
filepath := rctx.PathMap["filepath"]
filepath := rctx.GetSubpath("filepath")
params := &operator.FileExistsParams{
Filepath: filepath,
}
@@ -32,13 +31,9 @@ func (hand *Handler) FileExists(rctx *router.Context) {
}
func (hand *Handler) PutFile(rctx *router.Context) {
hand.logg.Debugf("Handle PutFile")
contentLength := rctx.GetHeader("Content-Length")
contentType := rctx.GetHeader("Content-Type")
filepath := rctx.PathMap["filepath"]
hand.logg.Debugf("Content-Length=%s", rctx.GetHeader("Content-Length"))
filepath := rctx.GetSubpath("filepath")
params := &operator.PutFileParams{
Filepath: filepath,
@@ -58,14 +53,11 @@ func (hand *Handler) PutFile(rctx *router.Context) {
}
func (hand *Handler) GetFile(rctx *router.Context) {
hand.logg.Debugf("Handle GetFile")
filepath := rctx.PathMap["filepath"]
filepath := rctx.GetSubpath("filepath")
params := &operator.GetFileParams{
Filepath: filepath,
}
hand.logg.Debugf("filepath: %s", filepath)
ctx := rctx.GetContext()
code, res, err := hand.oper.GetFile(ctx, params)
if err != nil {
@@ -90,9 +82,8 @@ func (hand *Handler) GetFile(rctx *router.Context) {
}
func (hand *Handler) DeleteFile(rctx *router.Context) {
hand.logg.Debugf("Handle DeleteFile")
filepath := rctx.PathMap["filepath"]
filepath := rctx.GetSubpath("filepath")
params := &operator.DeleteFileParams{
Filepath: filepath,
}
@@ -106,9 +97,8 @@ func (hand *Handler) DeleteFile(rctx *router.Context) {
}
func (hand *Handler) ListFiles(rctx *router.Context) {
hand.logg.Debugf("Handle ListFiles")
filepath := rctx.PathMap["filepath"]
filepath := rctx.GetSubpath("filepath")
params := &operator.ListFilesParams{
Filepath: filepath,
}
+1
View File
@@ -9,6 +9,7 @@ import (
func (hand *Handler) ManifestExists(rctx *router.Context) {
name, _ := rctx.GetSubpath("name")
reference, _ := rctx.GetSubpath("reference")
params := &operator.ManifestExistsParams{
Name: name,
Reference: reference,
+1 -1
View File
@@ -7,6 +7,6 @@ import (
)
func (hand *Handler) NotFound(rctx *router.Context) {
hand.logg.Debugf("Route for [%s %s] not found", rctx.Request.Method, rctx.Request.URL.String())
hand.logg.Warningf("Route for [%s %s] not found", rctx.Request.Method, rctx.Request.URL.String())
rctx.SetStatus(http.StatusNotFound)
}
-2
View File
@@ -8,8 +8,6 @@ import (
)
func (hand *Handler) SendHello(rctx *router.Context) {
hand.logg.Debugf("Handle SendHello")
params := &operator.SendHelloParams{}
res, _ := hand.oper.SendHello(params)
rctx.SetStatus(http.StatusOK)