MCPcopy Create free account
hub / github.com/SignTools/SignTools / GetInfo

Method GetInfo

src/storage/upload.go:44–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42}
43
44func (u *upload) GetInfo() (handler.FileInfo, error) {
45 fileName := FSName(u.id + ".info")
46 file, err := u.GetFile(fileName)
47 info := handler.FileInfo{}
48 if err != nil {
49 return info, errors.WithMessagef(err, "get %s", fileName)
50 }
51 fileBytes, err := io.ReadAll(file)
52 if err != nil {
53 return info, errors.WithMessagef(err, "read uplodaded file info")
54 }
55 if err := json.Unmarshal(fileBytes, &info); err != nil {
56 return info, errors.WithMessagef(err, "unmarshal uploaded file info")
57 }
58 return info, nil
59}
60
61func newUpload(id string) *upload {
62 return &upload{id: id, FileSystemBase: FileSystemBase{resolvePath: func(name FSName) string {

Callers

nothing calls this directly

Calls 2

FSNameTypeAlias · 0.85
GetFileMethod · 0.65

Tested by

no test coverage detected