MCPcopy
hub / github.com/IceWhaleTech/CasaOS / CheckAndMountByName

Method CheckAndMountByName

service/storage.go:50–65  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

48 return nil
49}
50func (s *storageStruct) CheckAndMountByName(name string) error {
51 storages, _ := MyService.Storage().GetStorages()
52 currentRemote, _ := httper.GetConfigByName(name)
53 mountPoint := currentRemote["mount_point"]
54 isMount := false
55 for _, v := range storages.MountPoints {
56 if v.MountPoint == mountPoint {
57 isMount = true
58 break
59 }
60 }
61 if !isMount {
62 return MyService.Storage().MountStorage(mountPoint, name+":")
63 }
64 return nil
65}
66func (s *storageStruct) CheckAndMountAll() error {
67 storages, err := MyService.Storage().GetStorages()
68 if err != nil {

Callers

nothing calls this directly

Calls 4

GetConfigByNameFunction · 0.92
GetStoragesMethod · 0.65
StorageMethod · 0.65
MountStorageMethod · 0.65

Tested by

no test coverage detected