[perf] Add trybot interfaces.

Bug: skia:10844
Change-Id: Iad66d02ff7351bc9c82283f8bb29519f5622dc56
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/327697
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
diff --git a/perf/go/trybot/ingester/ingester.go b/perf/go/trybot/ingester/ingester.go
new file mode 100644
index 0000000..72133a8
--- /dev/null
+++ b/perf/go/trybot/ingester/ingester.go
@@ -0,0 +1,12 @@
+package ingester
+
+import (
+	"go.skia.org/infra/perf/go/file"
+	"go.skia.org/infra/perf/go/trybot"
+)
+
+// Ingester converts file.Files into trybot.TryFiles as they arrive.
+type Ingester interface {
+	// Start a background Go routine that processes the incoming channel.
+	Start(<-chan file.File) (<-chan trybot.TryFile, error)
+}
diff --git a/perf/go/trybot/store/store.go b/perf/go/trybot/store/store.go
new file mode 100644
index 0000000..b1ec274
--- /dev/null
+++ b/perf/go/trybot/store/store.go
@@ -0,0 +1,35 @@
+// Package store stores the results from trybot runs.
+package store
+
+import (
+	"context"
+	"time"
+
+	"go.skia.org/infra/perf/go/trybot"
+)
+
+// ListResult is returned from TryBotStore.List().
+type ListResult struct {
+	CL    string
+	Patch int
+}
+
+// GetResult is returned from TryBotStore.Get() and represents a single trace
+// result.
+type GetResult struct {
+	TraceName string
+	Value     float32
+}
+
+// TryBotStore stores trybot results.
+type TryBotStore interface {
+	// Write a single file into the store.
+	Write(ctx context.Context, tryFile trybot.TryFile) error
+
+	// List returns all the unique CL/patch combinations
+	// that have arrived since 'since'.
+	List(ctx context.Context, since time.Time) ([]ListResult, error)
+
+	// Get all the results for a given cl and patch number.
+	Get(ctx context.Context, cl string, patch int) ([]GetResult, error)
+}
diff --git a/perf/go/trybot/trybot.go b/perf/go/trybot/trybot.go
new file mode 100644
index 0000000..16776b3
--- /dev/null
+++ b/perf/go/trybot/trybot.go
@@ -0,0 +1,22 @@
+// Package trybot has common types for the store and ingester sub-modules.
+package trybot
+
+import (
+	"time"
+)
+
+// TryFile represents a single file of trybot results.
+type TryFile struct {
+	// CL is the Changelist Id.
+	CL string
+
+	// PatchNumber is the index of the patch. Note this isn't the git hash of
+	// the patch.
+	PatchNumber int
+
+	// Filename, including the scheme, gs://, for example.
+	Filename string
+
+	// Timestamp of when the file was written.
+	Timestamp time.Time
+}