Documentation
¶
Index ¶
Constants ¶
const NTFSSbMagic = 0x5346544e
const SysNewFstatat = 262
Variables ¶
var InoFilterInstance = InoFilter{ // contains filtered or unexported fields }
Functions ¶
func HiddenFilter ¶ added in v0.1.2
HiddenFilter filters all hidden files and directories (with a dot prefix) and returns a corresponding boolean value.
func UTF16ToString ¶ added in v0.6.0
UTF16ToString is a copy of the standard syscall.UTF16ToString function, except it uses a buffer pool instead of creating a new one on each call.
Types ¶
type Allocator ¶ added in v0.6.0
type Allocator interface {
// Alloc allocates the required number of bytes using the specific allocator
// implementation. If the memory region cannot be allocated an error will be
// returned.
Alloc(size uint32) ([]byte, error)
}
Allocator defines a basic interface for the arena allocator.
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
FileInfo defines a custom fs.FileInfo implementation for wrapping the results from the file info system calls.
type FileInfoFilter ¶ added in v0.1.2
FileInfoFilter defines a custom function type for filtering *FileInfo instances against specific rules. The type implementation only tells if the current *FileInfo meets the specification by returning a boolean value.
type Info ¶
type Info struct {
Path string `json:"path"`
Volume string `json:"volume"`
FSName string `json:"fsName"`
Device string `json:"device"`
TotalBytes uint64 `json:"total"`
FreeBytes uint64 `json:"free"`
UsedBytes uint64 `json:"used"`
UsedPercent float64 `json:"usedPercent"`
IsDev uint8 `json:"isDev"`
}
Info contains information about a single drive/volume/mount. The data can be fetched using a corresponding operating system syscall against a target entry.
type InoFilter ¶ added in v0.1.0
type InoFilter struct {
// contains filtered or unexported fields
}
InoFilter filters files by inode value, preventing the double calculation of the same space on the disk. The filter must be manually reset before each new volume scan.
type List ¶
type SizeFilter ¶ added in v0.1.2
type SizeFilter struct {
// contains filtered or unexported fields
}
SizeFilter provided a FileInfoFilter implementation responsible for filtering FileInfo file instances by their size. The file's size must be within the defined boundaries, otherwise, it must be rejected.
The filter will check files only, and the size boundaries must be defined in bytes.
func NewSizeFilter ¶ added in v0.1.2
func NewSizeFilter(minLimit, maxLimit int64) *SizeFilter
func (*SizeFilter) Filter ¶ added in v0.1.2
func (sf *SizeFilter) Filter(fi FileInfo) bool
Filter filters the provided *FileInfo file instance by its size and returns a corresponding boolean value. For the directory type, the result will always be true.