Documentation ¶
Overview ¶
Package scanner implements a file system scanner and hasher.
Index ¶
- func BlockDiff(src, tgt []protocol.BlockInfo) (have, need []protocol.BlockInfo)
- func Blocks(r io.Reader, blocksize int, sizehint int64) ([]protocol.BlockInfo, error)
- func HashFile(path string, blockSize int) ([]protocol.BlockInfo, error)
- func PermsEqual(a, b uint32) bool
- func Verify(r io.Reader, blocksize int, blocks []protocol.BlockInfo) error
- type CurrentFiler
- type TempNamer
- type Walker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockDiff ¶
BlockDiff returns lists of common and missing (to transform src into tgt) blocks. Both block lists must have been created with the same block size.
func PermsEqual ¶
Types ¶
type CurrentFiler ¶
type Walker ¶
type Walker struct { // Dir is the base directory for the walk Dir string // Limit walking to this path within Dir, or no limit if Sub is blank Sub string // BlockSize controls the size of the block used when hashing. BlockSize int // List of patterns to ignore Ignores ignore.Patterns // If TempNamer is not nil, it is used to ignore tempory files when walking. TempNamer TempNamer // If CurrentFiler is not nil, it is queried for the current file before rescanning. CurrentFiler CurrentFiler // If IgnorePerms is true, changes to permission bits will not be // detected. Scanned files will get zero permission bits and the // NoPermissionBits flag set. IgnorePerms bool }
Click to show internal directories.
Click to hide internal directories.