Update smd repo to handle CRDs

This commit is contained in:
Antoine Pelisse
2019-01-29 14:24:00 -08:00
parent 7e4cc38401
commit 1751fc013f
14 changed files with 606 additions and 141 deletions

View File

@@ -154,6 +154,16 @@ func (s *Set) iteratePrefix(prefix Path, f func(Path)) {
s.Children.iteratePrefix(prefix, f)
}
// WithPrefix returns the subset of paths which begin with the given prefix,
// with the prefix not included.
func (s *Set) WithPrefix(pe PathElement) *Set {
subset, ok := s.Children.Get(pe)
if !ok {
return NewSet()
}
return subset
}
// setNode is a pair of PathElement / Set, for the purpose of expressing
// nested set membership.
type setNode struct {