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

Unified Diff: service/datastore/testable.go

Issue 1574353004: GitHub #8: Seed indexes from index.yml (Closed) Base URL: https://github.com/luci/gae@master
Patch Set: Created 4 years, 11 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
« service/datastore/index_test.go ('K') | « service/datastore/index_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/testable.go
diff --git a/service/datastore/testable.go b/service/datastore/testable.go
index 331156fbd4f7b33f74e3d9441b20a0b6488bdfac..2c8f28728633da9f3bc2c398a97af96453a89b1d 100644
--- a/service/datastore/testable.go
+++ b/service/datastore/testable.go
@@ -4,6 +4,8 @@
package datastore
+import "io"
iannucci 2016/01/13 19:12:20 always use import ( "io" ) style. It's easier
nishanths (utexas) 2016/01/14 21:12:56 Done.
+
// TestingSnapshot is an opaque implementation-defined snapshot type.
type TestingSnapshot interface {
ImATestingSnapshot()
@@ -73,4 +75,20 @@ type Testable interface {
// but never wants the in-memory versions of these entities to bleed through
// to the user code.
DisableSpecialEntities(bool)
+
+ // ParseIndexYAML parses the contents of a index YAML file into
+ // a list of datastore.IndexDefinitions.
+ //
+ // ParseIndexYAML panics if there was an error during parsing.
+ ParseIndexYAML(content io.Reader) []*IndexDefinition
+
+ // FindAndAddIndexYAML walks up from the directory of the source file
+ // until it finds a `index.yaml` or `index.yml` file.
+ // If an index YAML file is found, it opens and parses the file,
+ // and adds all the indexes found.
+ //
+ // FindAndAddIndexYAML panics if the root of the drive is reached without
+ // finding an index YAML file. FindAndAddIndexYAML also panics if there is
+ // an error reading the found index YAML file.
+ FindAndAddIndexYAML()
dnj 2016/01/13 16:16:40 I don't think this capability needs to be added to
iannucci 2016/01/13 19:12:20 If anything they should be top level methods in se
nishanths (utexas) 2016/01/14 21:12:56 Done. Moved to service/datastore with the method s
}
« service/datastore/index_test.go ('K') | « service/datastore/index_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698