Documentation ¶
Overview ¶
Package scanlib implements a basic reachability scanner for FFS data blobs, files, and root pointers.
Index ¶
- type Scanner
- func (s *Scanner) All() iter.Seq2[string, byte]
- func (s *Scanner) Blob(key string)
- func (s *Scanner) Chunks(n int) iter.Seq[[]string]
- func (s *Scanner) File(ctx context.Context, fp *file.File) error
- func (s *Scanner) IsRoot(key string) bool
- func (s *Scanner) Len() int
- func (s *Scanner) Remove(key string)
- func (s *Scanner) Root(ctx context.Context, rootKey string, rp *root.Root) error
- func (s *Scanner) RootOnly(rootKey string, rp *root.Root)
- func (s *Scanner) Stats() Stats
- type Stats
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) All ¶
All returns an iterator over all the key/value pairs in s. The value for each key is 'R' for a root, 'F' for a file, and '-' for a data blob.
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) Root ¶
Root adds the specified root, its index (if any), and all files reachable from its file pointer to s.
func (*Scanner) RootOnly ¶
RootOnly adds the specified root to the scan, including its index (if any), but excluding any blobs reachable from its file pointer.
Use Scanner.Root to completely scan a root.