service

package
v0.4.1-alpha1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 32 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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 {
	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()
}

func NewDiskService

func NewDiskService(db *gorm.DB) DiskService

type Services added in v0.4.0

type Services interface {
	Disk() DiskService
	USB() USBService
	LocalStorage() *v2.LocalStorageService
	Gateway() external.ManagementService
	Notify() external.NotifyService
	Shares() external.ShareService
	MessageBus() *message_bus.ClientWithResponses
}
var MyService Services

func NewService

func NewService(db *gorm.DB) Services

type USBService

type USBService interface {
	UpdateUSBAutoMount(state string)
	ExecUSBAutoMountShell(state string)

	GetSysInfo() host.InfoStat
	GetDeviceTree() (string, error)
}

func NewUSBService

func NewUSBService() USBService

Directories

Path Synopsis
@Author: LinkLeong link@icewhale.org
@Author: LinkLeong link@icewhale.org
v2
fs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL