splitted one operator module to file, account, image operators; splitted operator functions; etc

This commit is contained in:
2026-03-05 11:32:32 +02:00
parent 9ecd25ed0b
commit 80d6a244cf
54 changed files with 1049 additions and 826 deletions
+12 -12
View File
@@ -3,8 +3,8 @@ package filecli
import (
"net/url"
"path"
"strconv"
"strings"
"strconv"
)
const (
@@ -17,13 +17,13 @@ type Repository struct {
urlobj *url.URL
user, pass string
resource string
values url.Values
values url.Values
}
func ParsePath(rawpath string) (*Repository, error) {
repo := &Repository{
values: url.Values{},
}
values: url.Values{},
}
if !strings.Contains(rawpath, "://") {
rawpath = "https://" + rawpath
}
@@ -39,17 +39,17 @@ func ParsePath(rawpath string) (*Repository, error) {
repo.resource = path.Join("/", urlobj.Path)
urlobj.Path = "/"
repo.urlobj = urlobj
repo.values = urlobj.Query()
repo.values = urlobj.Query()
return repo, err
}
func (repo *Repository) Raw() string {
res := path.Join(repo.urlobj.Host, repo.resource)
query := repo.values.Encode()
if query != "" {
return res + "?" + query
}
return res
query := repo.values.Encode()
if query != "" {
return res + "?" + query
}
return res
}
func (repo *Repository) SetResource(resource string) {
@@ -61,11 +61,11 @@ func (repo *Repository) JoinResource(resource string) {
}
func (repo *Repository) PathType(typ string) {
repo.values.Set("pathType", typ)
repo.values.Set("pathType", typ)
}
func (repo *Repository) DryRun(yesno bool) {
repo.values.Set("dryRun", strconv.FormatBool(yesno))
repo.values.Set("dryRun", strconv.FormatBool(yesno))
}
func (repo *Repository) File() string {