added repocli

This commit is contained in:
2026-03-02 09:07:57 +02:00
parent e67f42a821
commit 1b025180f0
25 changed files with 1320 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
package repocli
import (
"github.com/stretchr/testify/require"
"fmt"
"testing"
)
func xxxTestResrerer(t *testing.T) {
ref, err := NewRepository("registry.example.com/lib/alpine")
require.NoError(t, err)
fmt.Printf("Manifest:\t%s\n", ref.Manifest("3.30.0"))
digest := SHA256Digest([]byte("qwerty"))
fmt.Printf("Blob:\t\t%s\n", ref.Blob(digest))
fmt.Printf("POST:\t\t%s\n", ref.Upload())
uuid := "8be4df61-93ca-11d2-aa0d-00e098032b8c"
rawurl, err := ref.Patch(uuid)
require.NoError(t, err)
fmt.Printf("PATH:\t\t%s\n", rawurl)
rawurl, err = ref.Put(uuid, digest)
fmt.Printf("PUT:\t\t%s\n", rawurl)
}