Index: common/dirwalk/observer.go |
diff --git a/common/dirwalk/observer.go b/common/dirwalk/observer.go |
new file mode 100644 |
index 0000000000000000000000000000000000000000..46e7bc86792ab5bb39c0c1d10378fcf43bfa5961 |
--- /dev/null |
+++ b/common/dirwalk/observer.go |
@@ -0,0 +1,24 @@ |
+// Copyright 2016 The LUCI Authors. All rights reserved. |
+// Use of this source code is governed under the Apache License, Version 2.0 |
+// that can be found in the LICENSE file. |
+ |
+package dirwalk |
+ |
+/** |
M-A Ruel
2016/09/15 14:31:02
Always use // comments for consistency. I do it th
mithro
2016/09/20 12:41:43
Done.
|
+Interface for receiving the results of walking a directory tree. |
+ |
+For performance reasons, small files and large files are treated differently. |
+ |
+SmallFile and LargeFile must be called in sorted order. |
+*/ |
+type WalkObserver interface { |
+ SmallFile(filename string, alldata []byte) |
+ LargeFile(filename string) |
M-A Ruel
2016/09/15 14:31:02
why not just have OnFile(path string, content []by
mithro
2016/09/20 12:41:43
I originally had a single call back which provided
M-A Ruel
2016/09/20 16:37:26
I disagree. The walk is finished when the function
mithro
2016/09/22 11:19:58
You seemed to miss the part where I mentioned the
|
+ |
+ //StartDir(dirname string) error |
+ //FinishDir(dirname string) |
+ |
+ Error(pathname string, err error) |
+ |
+ Finished() |
M-A Ruel
2016/09/15 14:31:02
It's finished when the function returns.
Overall
mithro
2016/09/20 12:41:44
See my comments below.
|
+} |