working commit

This commit is contained in:
2026-03-10 12:52:12 +02:00
parent d0a5fab362
commit d1ef1fbe50
42 changed files with 242 additions and 426 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ func (cli *Client) DeleteCollection(ctx context.Context, rawpath string) ([]byte
if err != nil {
return list, err
}
uri := ref.Collection()
uri := ref.CollectionEP()
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, uri, nil)
if err != nil {
return list, err
+1 -1
View File
@@ -14,7 +14,7 @@ func (cli *Client) DeleteFile(ctx context.Context, rawpath string) (bool, error)
if err != nil {
return exist, err
}
uri := ref.File()
uri := ref.FileEP()
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, uri, nil)
if err != nil {
return exist, err
+1 -1
View File
@@ -17,7 +17,7 @@ func (cli *Client) FileInfo(ctx context.Context, rawpath string) (bool, int64, s
if err != nil {
return exist, size, digest, err
}
uri := ref.File()
uri := ref.FileEP()
fmt.Println(uri)
req, err := http.NewRequestWithContext(ctx, http.MethodHead, uri, nil)
+1 -1
View File
@@ -16,7 +16,7 @@ func (cli *Client) GetFile(ctx context.Context, rawpath string, writer io.Writer
if err != nil {
return exist, err
}
uri := ref.File()
uri := ref.FileEP()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, uri, nil)
if err != nil {
+1 -1
View File
@@ -16,7 +16,7 @@ func (cli *Client) ListCollections(ctx context.Context, rawpath string) ([]byte,
if err != nil {
return list, err
}
uri := ref.Collections()
uri := ref.CollectionsEP()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, uri, nil)
if err != nil {
+1 -1
View File
@@ -16,7 +16,7 @@ func (cli *Client) ListFiles(ctx context.Context, rawpath string) ([]byte, error
if err != nil {
return list, err
}
uri := ref.Files()
uri := ref.FilesEP()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, uri, nil)
if err != nil {
+1 -1
View File
@@ -14,7 +14,7 @@ func (cli *Client) PutFile(ctx context.Context, rawpath string, src io.Reader, s
if err != nil {
return err
}
uri := ref.File()
uri := ref.FileEP()
req, err := http.NewRequestWithContext(ctx, http.MethodPut, uri, src)
if err != nil {
return err
+4 -4
View File
@@ -68,22 +68,22 @@ func (repo *Referer) DryRun(yesno bool) {
repo.values.Set("dryRun", strconv.FormatBool(yesno))
}
func (repo *Referer) File() string {
func (repo *Referer) FileEP() string {
curl := repo.urlobj.JoinPath("/v3/api/file/", repo.resource)
return curl.String()
}
func (repo *Referer) Files() string {
func (repo *Referer) FilesEP() string {
curl := repo.urlobj.JoinPath("/v3/api/files/", repo.resource)
return curl.String()
}
func (repo *Referer) Collection() string {
func (repo *Referer) CollectionEP() string {
curl := repo.urlobj.JoinPath("/v3/api/collection/", repo.resource)
return curl.String()
}
func (repo *Referer) Collections() string {
func (repo *Referer) CollectionsEP() string {
curl := repo.urlobj.JoinPath("/v3/api/collections/", repo.resource)
return curl.String()
}