Documentation ¶
Index ¶
- Constants
- Variables
- func IsDiskSupported(d model.LSBLKModel) bool
- func IsFormatSupported(d model.LSBLKModel) bool
- func ParseBlockDevices(str []byte) ([]model.LSBLKModel, error)
- func WalkDisk(rootBlk model.LSBLKModel, depth uint, ...) *model.LSBLKModel
- type DiskService
- type NotifyServer
- type Services
- type StorageService
- type USBService
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")
)
View Source
var (
MountLists map[string]*mountlib.MountPoint
)
Functions ¶
func IsDiskSupported ¶
func IsDiskSupported(d model.LSBLKModel) bool
func IsFormatSupported ¶ added in v0.4.5
func IsFormatSupported(d model.LSBLKModel) bool
func ParseBlockDevices ¶ added in v0.3.8
func ParseBlockDevices(str []byte) ([]model.LSBLKModel, error)
func WalkDisk ¶ added in v0.3.8
func WalkDisk(rootBlk model.LSBLKModel, depth uint, shouldStopAt func(blk model.LSBLKModel) bool) *model.LSBLKModel
Types ¶
type DiskService ¶
type DiskService interface { EnsureDefaultMergePoint() bool 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(m model.LSBLKModel) error UmountUSB(path string) error UpdateMountPointInDB(m model2.Volume) error DeleteMountPointFromDB(path, mountPoint string) error GetSerialAllFromDB() ([]model2.Volume, error) SaveMountPointToDB(m model2.Volume) error InitCheck() GetSystemDf() (model.DFDiskSpace, error) }
func NewDiskService ¶
func NewDiskService(db *gorm.DB) DiskService
type NotifyServer ¶ added in v0.4.3
func NewNotifyService ¶ added in v0.4.3
func NewNotifyService() NotifyServer
type Services ¶ added in v0.4.0
type Services interface { Disk() DiskService USB() USBService LocalStorage() *v2.LocalStorageService Gateway() external.ManagementService Notify() NotifyServer NotifySystem() external.NotifyService MessageBus() *message_bus.ClientWithResponses Storage() StorageService }
var MyService Services
func NewService ¶
type StorageService ¶ added in v0.4.3
type StorageService interface { MountStorage(mountPoint, fs string) error UnmountStorage(mountPoint string) error UnmountAllStorage() GetStorages() (httper.MountList, error) CreateConfig(data rc.Params, name string, t string) error CheckAndMountByName(name string) error CheckAndMountAll() error GetConfigByName(name string) []string GetAttributeValueByName(name, key string) string DeleteConfigByName(name string) GetConfig() (httper.RemotesResult, error) }
func NewStorageService ¶ added in v0.4.3
func NewStorageService() StorageService
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.