Documentation
¶
Index ¶
Constants ¶
View Source
const ( PersistentTypeNone = "none" PersistentTypeFStab = "fstab" PersistentTypeCasaOS = "casaos" )
Variables ¶
View Source
var Cache *cache.Cache
View Source
var ErrVolumeWithEmptyUUID = errors.New("cannot save volume with empty uuid")
Functions ¶
func IsDiskSupported ¶
func IsDiskSupported(d model.LSBLKModel) bool
Types ¶
type DiskService ¶
type DiskService interface {
AddPartition(path string) error
DeletePartition(path string) error
CheckSerialDiskMount()
FormatDisk(path string) error
GetDiskInfo(path string) model.LSBLKModel
GetPersistentTypeByUUID(uuid string) string
GetUSBDriveStatusList() []model.USBDriveStatus
LSBLK(isUseCache bool) []model.LSBLKModel
MountDisk(path, volume string) (string, error)
RemoveLSBLKCache()
SmartCTL(path string) model.SmartctlA
UmountPointAndRemoveDir(path string) error
UmountUSB(path string) error
UpdateMountPointInDB(m model2.Volume) error
DeleteMountPointFromDB(path, mountPoint string) error
GetSerialAllFromDB() ([]model2.Volume, error)
SaveMountPointToDB(m model2.Volume) error
}
func NewDiskService ¶
func NewDiskService(db *gorm.DB) DiskService
type Repository ¶
type Repository interface {
Disk() DiskService
USB() USBService
LocalStorage() *v2.LocalStorageService
Gateway() gateway.ManagementService
Notify() common.NotifyService
}
var MyService Repository
func NewService ¶
func NewService(db *gorm.DB) Repository
type USBService ¶
type USBService interface {
UpdateUSBAutoMount(state string)
ExecUSBAutoMountShell(state string)
GetSysInfo() host.InfoStat
GetDeviceTree() (string, error)
}
func NewUSBService ¶
func NewUSBService() USBService
Click to show internal directories.
Click to hide internal directories.