Documentation
¶
Index ¶
Constants ¶
View Source
const RFC3339 string = "2006-01-02T15:04:05"
RFC3339 is the same as time.RFC3339 but without timezones.
Variables ¶
View Source
var ( // ErrPlatformNotSupported indicates that the current platform does not // suport trashing files or the API isn't fully implemented. ErrPlatformNotSupported = errors.New("platform not supported") ErrAlreadyExists = errors.New("couldn't restore file, already exists, apply force") ErrOnlyOneGlobAllowed = errors.New("only one glob is allowed") )
Functions ¶
Types ¶
type QueryOptions ¶
QueryOptions allows to configure the Query-Call. Options Globs and Paths aren't allowed to both be set.
type QueryResult ¶
type QueryResult struct {
// Matches are the query results, mapped from the query input (globa / path)
// to the respective trashed files. Note that the same file can be trashed
// multiple times and a glob can match multiple files. Therefore, expect
// multiple entries in both scenarios.
Matches map[string][]TrashedFileInfo
}
func Query ¶
func Query(options QueryOptions) (*QueryResult, error)
type TrashedFileInfo ¶
type TrashedFileInfo interface {
// OriginalPath is the files path before it was deleted.
OriginalPath() string
// DeletionDate is the deletion date in the computers local timezone.
DeletionDate() time.Time
// Restore will attempt restoring the file to its previous location.
Restore(force bool) error
// Delete will permanently deleting the underlying file. Note that we do not
// zero the respective bytes on the disk.
Delete() error
// UniqueIdentifier can be used to uniquely identify a file if the path and
// deletion date are exactly the same. This CAN be useful file restoration.
UniqueIdentifier() string
}
TrashedFileInfo represents a file that has been deleted and now resides in the trashbin.
Click to show internal directories.
Click to hide internal directories.