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

Method GetFileByPath

six_cloud/user.go:44–57  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

42}
43
44func (user *SixUser) GetFileByPath(path string) (*SixFile, error) {
45 id := models.ToIdentity(path)
46 b, err := user.Client.GetBytes("https://api.2dland.cn/v3/file/" + id)
47 if err != nil {
48 return nil, err
49 }
50 var file *SixFile
51 err = json.Unmarshal(b, &file)
52 if err != nil {
53 return nil, err
54 }
55 file.owner = user
56 return file, nil
57}
58
59func (user *SixUser) GetOfflineTasks() ([]*SixOfflineTask, error) {
60 info := gjson.Parse(user.Client.PostJsonObject("https://api.2dland.cn/v3/offline/list", models.B{"skip": 0, "limit": 500}))

Callers 3

PreviewMethod · 0.80
UploadMethod · 0.80
CheckSumMethod · 0.80

Calls 2

ToIdentityFunction · 0.92
GetBytesMethod · 0.80

Tested by

no test coverage detected