vbatts / go-mtree

File systems verification utility and library, in likeness of mtree(8)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[RFE] given a manifest, return keywords used

vbatts opened this issue · comments

Something like:

$ gomtree -f ./foo.mtree -list-used

to return a parseable string of keywords used, such that subsequent tooling could easily choose to validate the manifest against that set of keywords or less (i.e. ignoring mtimes).

working on this on 739746. I'm wondering if instead of just returning a slice of keywords, we could create something like a Collector struct that would output meaningful information about the mtree spec. For example:

type Collector struct {
   CollectType1
   CollectType2
   .
   .
   .
}
ParseSpec(r io.Reader, collectorArgs... ) (*DirectoryHierarchy, *Collector, error) {
}

This has no effect on gomtree's functionality, but it might be a nice feature to have, especially when working with mtree files that represent a really large directory.