Documentation ¶
Index ¶
- Variables
- func API_Rclone_remountAll(w http.ResponseWriter, req *http.Request)
- func AddDeviceToRaid(name string, device string) error
- func CreateGPTTable(diskPath string) (io.Reader, error)
- func CreateRaidArray(config RaidConfig) error
- func CreateSinglePartition(diskPath string) (io.Reader, error)
- func CreateSnapRAID(raidOptions utils.SnapRAIDConfig, editRaid string) error
- func DeleteRaidArray(name string) error
- func DeleteSnapRAID(name string) error
- func FormatDisk(diskPath string, filesystemType string) (io.Reader, error)
- func FormatDiskRoute(w http.ResponseWriter, req *http.Request)
- func GetDiskUsage(path string) (perc uint64, err error)
- func GetRaidInfo() ([]map[string]interface{}, error)
- func GetRaidStatus(name string) (map[string]interface{}, error)
- func InitRemoteStorage() bool
- func InitSnapRAIDConfig()
- func IsDiskMounted(diskPath string) (bool, error)
- func ListDirectoryRoute(w http.ResponseWriter, req *http.Request)
- func ListDisksRoute(w http.ResponseWriter, req *http.Request)
- func ListMountsRoute(w http.ResponseWriter, req *http.Request)
- func ListSmartDef(w http.ResponseWriter, req *http.Request)
- func MergeRoute(w http.ResponseWriter, req *http.Request)
- func Mount(path, mountpoint string, permanent bool, chown string) error
- func MountMergerFS(paths []string, mountpoint string, opts string, permanent bool, chown string) error
- func MountRoute(w http.ResponseWriter, req *http.Request)
- func RaidAddDeviceRoute(w http.ResponseWriter, req *http.Request)
- func RaidCreateRoute(w http.ResponseWriter, req *http.Request)
- func RaidDeleteRoute(w http.ResponseWriter, req *http.Request)
- func RaidListRoute(w http.ResponseWriter, req *http.Request)
- func RaidReplaceDeviceRoute(w http.ResponseWriter, req *http.Request)
- func RaidResizeRoute(w http.ResponseWriter, req *http.Request)
- func RaidStatusRoute(w http.ResponseWriter, req *http.Request)
- func ReplaceDeviceInRaid(name string, oldDevice string, newDevice string) error
- func ResizeRaidArray(name string) error
- func Restart()
- func RunRClone(args []string)
- func RunRCloneCommand(command []string) (*exec.Cmd, io.WriteCloser, *bytes.Buffer, *bytes.Buffer)
- func RunSnapRAIDFix(raid utils.SnapRAIDConfig) error
- func RunSnapRAIDScrub(raid utils.SnapRAIDConfig) error
- func RunSnapRAIDStatus(raid utils.SnapRAIDConfig) (string, error)
- func RunSnapRAIDSync(raid utils.SnapRAIDConfig) error
- func SNAPRaidCRUDRoute(w http.ResponseWriter, req *http.Request)
- func SnapRAIDEditRoute(w http.ResponseWriter, req *http.Request)
- func SnapRAIDRunRoute(w http.ResponseWriter, req *http.Request)
- func StopAllRCloneProcess(forever bool)
- func ToggleSnapRAID(name string, enable bool) error
- func Unmount(mountpoint string, permanent bool) error
- func UnmountRoute(w http.ResponseWriter, req *http.Request)
- type BlockDevice
- type DirectoryListing
- type DiskInfo
- type FormatDiskJSON
- type MergeRequest
- type MountPoint
- type MountRequest
- type RCloneProcess
- type RaidConfig
- type RaidDeviceRequest
- type RaidReplaceDeviceRequest
- type RcloneStatsObj
- type RemoteStorage
- type SMARTData
- type SnapRAIDStatus
- type StorageInfo
- type StorageRoutes
Constants ¶
This section is empty.
Variables ¶
var CachedRemoteStorageList []StorageInfo
var StorageRoutesList []StorageRoutes
Functions ¶
func API_Rclone_remountAll ¶ added in v0.17.0
func API_Rclone_remountAll(w http.ResponseWriter, req *http.Request)
func AddDeviceToRaid ¶ added in v0.17.0
AddDeviceToRaid adds a new device to an existing RAID array
func CreateRaidArray ¶ added in v0.17.0
func CreateRaidArray(config RaidConfig) error
CreateRaidArray creates a new RAID array using mdadm
func CreateSnapRAID ¶
func CreateSnapRAID(raidOptions utils.SnapRAIDConfig, editRaid string) error
Create a SnapRAID configuration
func DeleteRaidArray ¶ added in v0.17.0
DeleteRaidArray removes a RAID array
func DeleteSnapRAID ¶
func FormatDiskRoute ¶
func FormatDiskRoute(w http.ResponseWriter, req *http.Request)
func GetDiskUsage ¶
func GetRaidInfo ¶ added in v0.17.0
GetRaidInfo returns detailed information about all RAID arrays
func GetRaidStatus ¶ added in v0.17.0
GetRaidStatus returns the status of a specific RAID array
func InitRemoteStorage ¶ added in v0.17.0
func InitRemoteStorage() bool
func InitSnapRAIDConfig ¶
func InitSnapRAIDConfig()
func ListDirectoryRoute ¶ added in v0.17.0
func ListDirectoryRoute(w http.ResponseWriter, req *http.Request)
func ListDisksRoute ¶
func ListDisksRoute(w http.ResponseWriter, req *http.Request)
func ListMountsRoute ¶
func ListMountsRoute(w http.ResponseWriter, req *http.Request)
func ListSmartDef ¶
func ListSmartDef(w http.ResponseWriter, req *http.Request)
func MergeRoute ¶
func MergeRoute(w http.ResponseWriter, req *http.Request)
MergeRoute handles merging filesystem requests
func MountMergerFS ¶
func MountMergerFS(paths []string, mountpoint string, opts string, permanent bool, chown string) error
Mount mounts a filesystem located at 'path' to 'mountpoint'.
func MountRoute ¶
func MountRoute(w http.ResponseWriter, req *http.Request)
MountRoute handles mounting filesystem requests
func RaidAddDeviceRoute ¶ added in v0.17.0
func RaidAddDeviceRoute(w http.ResponseWriter, req *http.Request)
func RaidCreateRoute ¶ added in v0.17.0
func RaidCreateRoute(w http.ResponseWriter, req *http.Request)
func RaidDeleteRoute ¶ added in v0.17.0
func RaidDeleteRoute(w http.ResponseWriter, req *http.Request)
func RaidListRoute ¶ added in v0.17.0
func RaidListRoute(w http.ResponseWriter, req *http.Request)
func RaidReplaceDeviceRoute ¶ added in v0.17.0
func RaidReplaceDeviceRoute(w http.ResponseWriter, req *http.Request)
func RaidResizeRoute ¶ added in v0.17.0
func RaidResizeRoute(w http.ResponseWriter, req *http.Request)
func RaidStatusRoute ¶ added in v0.17.0
func RaidStatusRoute(w http.ResponseWriter, req *http.Request)
func ReplaceDeviceInRaid ¶ added in v0.17.0
ReplaceDeviceInRaid replaces a failed device in a RAID array
func ResizeRaidArray ¶ added in v0.17.0
ResizeRaidArray resizes a RAID array to use all available space
func RunRCloneCommand ¶ added in v0.17.0
func RunSnapRAIDFix ¶
func RunSnapRAIDFix(raid utils.SnapRAIDConfig) error
func RunSnapRAIDScrub ¶
func RunSnapRAIDScrub(raid utils.SnapRAIDConfig) error
func RunSnapRAIDStatus ¶
func RunSnapRAIDStatus(raid utils.SnapRAIDConfig) (string, error)
func RunSnapRAIDSync ¶
func RunSnapRAIDSync(raid utils.SnapRAIDConfig) error
func SNAPRaidCRUDRoute ¶
func SNAPRaidCRUDRoute(w http.ResponseWriter, req *http.Request)
func SnapRAIDEditRoute ¶
func SnapRAIDEditRoute(w http.ResponseWriter, req *http.Request)
func SnapRAIDRunRoute ¶
func SnapRAIDRunRoute(w http.ResponseWriter, req *http.Request)
UnmountRoute handles unmounting filesystem requests
func StopAllRCloneProcess ¶ added in v0.17.0
func StopAllRCloneProcess(forever bool)
func ToggleSnapRAID ¶
func UnmountRoute ¶
func UnmountRoute(w http.ResponseWriter, req *http.Request)
UnmountRoute handles unmounting filesystem requests
Types ¶
type BlockDevice ¶
type BlockDevice struct { lsblk.BlockDevice Children []BlockDevice `json:"children"` Usage uint64 `json:"usage"` SMART SMARTData `json:"smart"` // Add SMART data field }
func GetRecursiveDiskUsageAndSMARTInfo ¶
func GetRecursiveDiskUsageAndSMARTInfo(devices []lsblk.BlockDevice) ([]BlockDevice, error)
Function to get recursive disk usage and SMART information
func ListDisks ¶
func ListDisks() ([]BlockDevice, error)
type DirectoryListing ¶ added in v0.17.0
type DirectoryListing struct { Name string `json:"name"` Type string `json:"type"` Size int64 `json:"size"` IsDir bool `json:"isDir"` Ext string `json:"ext"` Created int64 `json:"created"` UID uint32 `json:"uid"` GID uint32 `json:"gid"` FullPath string `json:"fullPath"` }
func ListDirectory ¶ added in v0.17.0
func ListDirectory(path string) ([]DirectoryListing, error)
type FormatDiskJSON ¶
type MergeRequest ¶
type MergeRequest struct { Branches []string `json:"branches"` MountPoint string `json:"mountPoint"` Permanent bool `json:"permanent"` Chown string `json:"chown"` Opts string `json:"opts"` }
Assuming the structure for the mount/unmount request
type MountPoint ¶
type MountPoint struct { Path string `json:"path"` Permenant bool `json:"permenant"` Device string `json:"device"` Type string `json:"type"` Opts []string `json:"opts"` }
func ListMounts ¶
func ListMounts() ([]MountPoint, error)
ListMounts lists all the mount points on the system
type MountRequest ¶
type MountRequest struct { Path string `json:"path"` MountPoint string `json:"mountPoint"` Permanent bool `json:"permanent"` Chown string `json:"chown"` }
Assuming the structure for the mount/unmount request
type RCloneProcess ¶ added in v0.17.0
type RCloneProcess struct { RcloneCmd *exec.Cmd RcloneRestart chan bool RestartCount int LastRestart time.Time Main bool }
func (*RCloneProcess) SetLastRestart ¶ added in v0.17.0
func (rp *RCloneProcess) SetLastRestart(v time.Time)
func (*RCloneProcess) SetRcloneRestartCount ¶ added in v0.17.0
func (rp *RCloneProcess) SetRcloneRestartCount(v int)
type RaidConfig ¶ added in v0.17.0
type RaidConfig struct { Name string `json:"name"` Level int `json:"level"` // 0, 1, 5, 6, 10 Devices []string `json:"devices"` // List of device paths Spares []string `json:"spares"` // List of spare device paths Metadata string `json:"metadata"` // Metadata version (default: 1.2) Filesystem string `json:"filesystem"` // Filesystem to use (default: ext4) }
RaidConfig represents the configuration for creating a new RAID array
type RaidDeviceRequest ¶ added in v0.17.0
type RaidDeviceRequest struct {
Device string `json:"device"`
}
type RaidReplaceDeviceRequest ¶ added in v0.17.0
type RcloneStatsObj ¶ added in v0.17.0
func RCloneStats ¶ added in v0.17.0
func RCloneStats() (RcloneStatsObj, error)
type RemoteStorage ¶ added in v0.17.0
type SMARTData ¶
type SMARTData struct { smart.GenericAttributes AdditionalData interface{} Thresholds interface{} }
type SnapRAIDStatus ¶
type SnapRAIDStatus struct { utils.SnapRAIDConfig Status string }
type StorageInfo ¶ added in v0.17.0
func ListStorage ¶ added in v0.17.0
func ListStorage() ([]StorageInfo, error)