Documentation
¶
Overview ¶
Package scanlib implements a basic reachability scanner for FFS data blobs, files, and root pointers.
Index ¶
- type Scanner
- func (s *Scanner) AddBareRoot(rootKey string, rp *root.Root)
- func (s *Scanner) All() iter.Seq2[string, Type]
- func (s *Scanner) Chunks(n int) iter.Seq[[]string]
- func (s *Scanner) Data(key string)
- func (s *Scanner) Has(key string) bool
- func (s *Scanner) IsRoot(key string) bool
- func (s *Scanner) Len() int
- func (s *Scanner) Remove(key string)
- func (s *Scanner) ScanFile(ctx context.Context, fp *file.File) error
- func (s *Scanner) ScanRoot(ctx context.Context, rootKey string, rp *root.Root) error
- func (s *Scanner) Stats() Stats
- func (s *Scanner) Type(key string) Type
- type Stats
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
A Scanner scans all the blobs reachable from a collection of root and file pointers.
func NewScanner ¶
NewScanner creates a new empty Scanner that reads data from src.
func (*Scanner) AddBareRoot ¶ added in v0.20.15
AddBareRoot adds the specified root to the scan, including its index (if any), but excluding any blobs reachable from its file or chain pointers.
Use Scanner.ScanRoot to completely scan a root.
func (*Scanner) Chunks ¶
Chunks returns consecutive chunks of the keys in s each having at most n elements and together spanning the complete set of keys recorded. The keys are returned in lexicographic order.
func (*Scanner) ScanFile ¶ added in v0.20.15
AddFile adds all the files and data blobs reachable from fp to s.
func (*Scanner) ScanRoot ¶ added in v0.20.15
ScanRoot adds the specified root, its index (if any), and all files reachable from its file pointer to s.
type Stats ¶
type Stats struct {
NumRoots int // number of distinct roots
NumFiles int // number of distinct files
NumBlobs int // number of distinct data blobs
}
Stats records aggregate statistics about a scan.