38 lines
993 B
Go
38 lines
993 B
Go
/*
|
|
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
|
|
*
|
|
* This work is published and licensed under a Creative Commons
|
|
* Attribution-NonCommercial-NoDerivatives 4.0 International License.
|
|
*
|
|
* Distribution of this work is permitted, but commercial use and
|
|
* modifications are strictly prohibited.
|
|
*/
|
|
|
|
package repocli
|
|
|
|
import (
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"fmt"
|
|
"testing"
|
|
|
|
"mstore/pkg/digest"
|
|
)
|
|
|
|
func xxxTestResrerer(t *testing.T) {
|
|
ref, err := NewReferer("registry.example.com/lib/alpine:3.30.0")
|
|
require.NoError(t, err)
|
|
|
|
fmt.Printf("Manifest:\t%s\n", ref.ManifestEP())
|
|
|
|
digobj := digest.NewDigest(digest.SHA256, []byte("qwerty"))
|
|
fmt.Printf("Blob:\t\t%s\n", ref.BlobEP(digobj.Encoded()))
|
|
fmt.Printf("POST:\t\t%s\n", ref.UploadEP())
|
|
uuid := "8be4df61-93ca-11d2-aa0d-00e098032b8c"
|
|
rawurl, err := ref.PatchEP(uuid)
|
|
require.NoError(t, err)
|
|
fmt.Printf("PATH:\t\t%s\n", rawurl)
|
|
rawurl, err = ref.PutEP(uuid, digobj.Encoded())
|
|
fmt.Printf("PUT:\t\t%s\n", rawurl)
|
|
}
|