service

package
v0.4.10-alpha1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

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")
)
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

type NotifyServer interface {
	SendNotify(name string, message map[string]interface{}) error
}

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
	Shares() external.ShareService
	MessageBus() *message_bus.ClientWithResponses
	Storage() StorageService
}
var MyService Services

func NewService

func NewService(db *gorm.DB) Services

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

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