SetFilters allows passing selective roots (includes) and ignores (excludes). Ignores are a list of patterns conforming to the glob standard, with support for double star
(roots []string, excludes []string)
| 78 | // SetFilters allows passing selective roots (includes) and ignores (excludes). |
| 79 | // Ignores are a list of patterns conforming to the glob standard, with support for double star |
| 80 | func (s *Sync) SetFilters(roots []string, excludes []string) { |
| 81 | if roots != nil { |
| 82 | s.Roots = roots |
| 83 | } |
| 84 | for _, i := range excludes { |
| 85 | if g, e := glob.Compile(i, '/'); e == nil { |
| 86 | s.Ignores = append(s.Ignores, g) |
| 87 | } else { |
| 88 | log.Logger(runtime.CoreBackground()).Error("Unsupported glob pattern format!", zap.Error(e)) |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | // SetPatchListener adds a listener on the Patch channel to do something with patches |
| 94 | // before they are processed |
nothing calls this directly
no test coverage detected