working commit

This commit is contained in:
2026-02-21 12:31:39 +02:00
parent 3220e2d78f
commit cd37a4508c
37 changed files with 354 additions and 319 deletions
+9 -9
View File
@@ -16,7 +16,7 @@ import (
"net/http"
"strconv"
"mstore/pkg/auxid"
"mstore/pkg/auxuuid"
)
type BlobExistsParams struct {
@@ -30,7 +30,7 @@ type BlobExistsResult struct {
//Exists bool
}
func (oper *Operator) BlobExists(ctx context.Context, params *BlobExistsParams) (*BlobExistsResult, int, error) {
func (oper *Operator) BlobExists(ctx context.Context, operatorID string, params *BlobExistsParams) (*BlobExistsResult, int, error) {
var err error
res := &BlobExistsResult{}
@@ -73,17 +73,17 @@ type PostUploadParams struct {
From string
}
type PostUploadResult struct {
DockerUploadUUID uint64
DockerUploadUUID string
Location string
ContentLength string
}
func (oper *Operator) PostUpload(ctx context.Context, params *PostUploadParams) (*PostUploadResult, int, error) {
func (oper *Operator) PostUpload(ctx context.Context, operatorID string, params *PostUploadParams) (*PostUploadResult, int, error) {
var err error
res := &PostUploadResult{}
if params.Digest == "" {
uuid := uuid.NewUUID()
uuid := auxuuid.NewUUID()
location := fmt.Sprintf("/v2/%s/blobs/uploads/%s", params.Name, uuid)
res.DockerUploadUUID = uuid
res.Location = location
@@ -110,7 +110,7 @@ type PatchUploadResult struct {
}
// TODO: partial uploading by range?
func (oper *Operator) PatchUpload(ctx context.Context, params *PatchUploadParams) (*PatchUploadResult, int, error) {
func (oper *Operator) PatchUpload(ctx context.Context, operatorID string, params *PatchUploadParams) (*PatchUploadResult, int, error) {
var err error
res := &PatchUploadResult{}
@@ -177,7 +177,7 @@ type PutUploadResult struct {
Location string
}
func (oper *Operator) PutUpload(ctx context.Context, params *PutUploadParams) (*PutUploadResult, int, error) {
func (oper *Operator) PutUpload(ctx context.Context, operatorID string, params *PutUploadParams) (*PutUploadResult, int, error) {
var err error
res := &PutUploadResult{}
@@ -234,7 +234,7 @@ type GetBlobResult struct {
ReadCloser io.ReadCloser
}
func (oper *Operator) GetBlob(ctx context.Context, params *GetBlobParams) (*GetBlobResult, int, error) {
func (oper *Operator) GetBlob(ctx context.Context, operatorID string, params *GetBlobParams) (*GetBlobResult, int, error) {
var err error
res := &GetBlobResult{}
@@ -282,7 +282,7 @@ type DeleteBlobResult struct{}
// - It also prevents the manifest from being issued, as one
// of the layers is missing.
func (oper *Operator) DeleteBlob(ctx context.Context, params *DeleteBlobParams) (*DeleteBlobResult, int, error) {
func (oper *Operator) DeleteBlob(ctx context.Context, operatorID string, params *DeleteBlobParams) (*DeleteBlobResult, int, error) {
var err error
res := &DeleteBlobResult{}