device

package
v0.0.0-...-d04fe6a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	DeviceID       int
	MountPoint     string
	DeviceSerial   string
	AvailableSpace uint64
	AllocatedSpace uint64
}

Device represents a mount point on the system that can be used for backing up files

func MakeDevice

func MakeDevice(devID int, path string, serial string) (Device, error)

MakeDevice creates a device based on the provided path and optional serial

func (*Device) RemainingSpace

func (dev *Device) RemainingSpace() uint64

RemainingSpace returns the amount of space remaining on the device

func (*Device) ReserveSpace

func (dev *Device) ReserveSpace(needed int64)

ReserveSpace reserves the requested space on the device Space can be negative, to free allocated space

Jump to

Keyboard shortcuts

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