MCPcopy Create free account
hub / github.com/pydio/cells / SetFilters

Method SetFilters

common/sync/task/sync.go:80–91  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
80func (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

Callers

nothing calls this directly

Calls 3

LoggerFunction · 0.92
CoreBackgroundFunction · 0.92
ErrorMethod · 0.65

Tested by

no test coverage detected