service

package
v0.0.0-...-33b86ef Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 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

func IsFormatSupported(d model.LSBLKModel) bool

func ParseBlockDevices

func ParseBlockDevices(str []byte) ([]model.LSBLKModel, error)

func WalkDisk

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

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

func NewNotifyService

func NewNotifyService() NotifyServer

type Services

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

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

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
v2
fs

Jump to

Keyboard shortcuts

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