MCPcopy Create free account
hub / github.com/Mrs4s/six-cli / CreateUploadTree

Method CreateUploadTree

six_cloud/user.go:136–150  ·  view source on GitHub ↗
(remote string, files []string)

Source from the content-addressed store, hash-verified

134}
135
136func (user *SixUser) CreateUploadTree(remote string, files []string) map[string]string {
137 res := make(map[string]string)
138 for _, f := range files {
139 p := remote + "/" + fs.GetFileName(f)
140 if fs.IsDir(f) {
141 _ = user.CreateDirectory(p)
142 for k, v := range user.CreateUploadTree(p, fs.GetDirEntities(f)) {
143 res[k] = v
144 }
145 continue
146 }
147 res[p] = f
148 }
149 return res
150}
151
152func (user *SixUser) CreateUploadToken(path, name, hash string) SixUploadToken {
153 info := gjson.Parse(user.Client.PostJsonObject("https://api.2dland.cn/v3/file/uploadToken", models.B{"path": path, "name": name, "hash": hash}))

Callers 1

UploadMethod · 0.80

Calls 4

CreateDirectoryMethod · 0.95
GetFileNameFunction · 0.92
IsDirFunction · 0.92
GetDirEntitiesFunction · 0.92

Tested by

no test coverage detected