scanner

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: Apache-2.0, BSD-3-Clause, CC-BY-4.0, + 2 more Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparator

type Comparator interface {
	HasChanged(other fs.FileHandle) bool
	// contains filtered or unexported methods
}

Comparator compares ...

func NewComparator

func NewComparator(method string, fh fs.FileHandle) (Comparator, error)

type CompareByContent

type CompareByContent struct {
	// contains filtered or unexported fields
}

compare by content

func (*CompareByContent) HasChanged

func (self *CompareByContent) HasChanged(other fs.FileHandle) bool

type CompareByMD5

type CompareByMD5 struct {
	// contains filtered or unexported fields
}

compare by md5 hash

func (*CompareByMD5) HasChanged

func (self *CompareByMD5) HasChanged(other fs.FileHandle) bool

type CompareByMTime

type CompareByMTime struct {
	// contains filtered or unexported fields
}

by modification time

func (*CompareByMTime) HasChanged

func (self *CompareByMTime) HasChanged(other fs.FileHandle) bool

type CompareBySize

type CompareBySize struct {
	// contains filtered or unexported fields
}

by size

func (*CompareBySize) HasChanged

func (self *CompareBySize) HasChanged(other fs.FileHandle) bool

type CompareBySizeAndModTime

type CompareBySizeAndModTime struct {
	// contains filtered or unexported fields
}

by size and modification time

func (*CompareBySizeAndModTime) HasChanged

func (self *CompareBySizeAndModTime) HasChanged(other fs.FileHandle) bool

type DateRange

type DateRange struct {
	From time.Time `json:"from"`
	To   time.Time `json:"to"`
}

DateRange with from and to dates.

  • time is ignored
  • dates are inclusive

func NDaysBack

func NDaysBack(n int, to time.Time) DateRange

func NewDateRange

func NewDateRange(from time.Time, to time.Time) (DateRange, error)

func (*DateRange) IsAfter

func (self *DateRange) IsAfter(other time.Time) bool

func (*DateRange) IsBefore

func (self *DateRange) IsBefore(other time.Time) bool

func (DateRange) MarshalJSON

func (self DateRange) MarshalJSON() ([]byte, error)

func (*DateRange) String

func (self *DateRange) String() string

func (*DateRange) UnmarshalJSON

func (self *DateRange) UnmarshalJSON(b []byte) error

type FileVersion

type FileVersion struct {
	Current  fs.FileHandle `json:"current"`
	Backup   fs.FileHandle `json:"backup"`
	Snapshot zfs.Snapshot  `json:"snapshot"`
}

type ScanResult

type ScanResult struct {
	FileVersions        []FileVersion `json:"fileVersions"`
	DateRange           DateRange     `json:"dateRange"`
	SnapsScanned        int           `json:"snapsScanned"`
	SnapsToScan         int           `json:"snapsToScan"`
	SnapsFileMissing    int           `json:"snapsFileMissing"`
	LastScannedSnapshot zfs.Snapshot  `json:"lastScannedSnapshot"`
	ScanDuration        time.Duration `json:"scanDuration"`
}

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(dateRange DateRange, compareMethod string, dataset zfs.Dataset, zfs zfs.ZFS) Scanner

func (*Scanner) FindFileVersions

func (self *Scanner) FindFileVersions(pathCurrentVersion string) (ScanResult, error)

Jump to

Keyboard shortcuts

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