working commit
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user