Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Unified Diff: common/dirwalk/observer.go

Issue 2054763004: luci-go/common/dirwalk: Code for walking a directory tree efficiently Base URL: https://github.com/luci/luci-go@master
Patch Set: Fixes. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: common/dirwalk/observer.go
diff --git a/common/dirwalk/observer.go b/common/dirwalk/observer.go
new file mode 100644
index 0000000000000000000000000000000000000000..f855c05df0191afdf9546af85d94e1361788608e
--- /dev/null
+++ b/common/dirwalk/observer.go
@@ -0,0 +1,23 @@
+// 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
+
+// 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)
+
+ //StartDir(dirname string) error
+ //FinishDir(dirname string)
+
+ Error(pathname string, err error)
+
+ Finished()
+}

Powered by Google App Engine
This is Rietveld 408576698