Index: milo/buildsource/id.go |
diff --git a/milo/buildsource/id.go b/milo/buildsource/id.go |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3b79766c05a5265141e4e461fa31ebe892c2f2bb |
--- /dev/null |
+++ b/milo/buildsource/id.go |
@@ -0,0 +1,26 @@ |
+// Copyright 2017 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 buildsource |
+ |
+import ( |
+ "golang.org/x/net/context" |
+ |
+ "github.com/luci/luci-go/milo/api/resp" |
+) |
+ |
+// ID represents a universal 'build' ID. Each subpackage of buildsource |
+// implements an ID (as the type BuildID, e.g. swarming.BuildID), which has |
+// buildsource-specific fields, but always implements this ID interface. |
+// |
+// The frontend constructs an ID from the appropriate buildsource, then calls |
+// its .Get() method to get the generic MiloBuild representation. |
+type ID interface { |
+ Get(c context.Context) (*resp.MiloBuild, error) |
+ |
+ // GetLog is only implemented by swarming; this is for serving the deprecated |
+ // swarming/task/<id>/steps/<logname> |
+ // API. Once that's removed, this should be removed as well. |
+ GetLog(c context.Context, logname string) (text string, closed bool, err error) |
+} |