maintner: start of proto file

Change-Id: I94f1bdc212ebb5565690df61deebc57dfcefa58e
Reviewed-on: https://go-review.googlesource.com/36895
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/maintner/maintpb/maintner.pb.go b/maintner/maintpb/maintner.pb.go
new file mode 100644
index 0000000..d4df160
--- /dev/null
+++ b/maintner/maintpb/maintner.pb.go
@@ -0,0 +1,263 @@
+// Code generated by protoc-gen-go.
+// source: maintner.proto
+// DO NOT EDIT!
+
+/*
+Package maintpb is a generated protocol buffer package.
+
+It is generated from these files:
+	maintner.proto
+
+It has these top-level messages:
+	Mutation
+	GithubIssueMutation
+	GithubIssueCommentMutation
+	GithubUser
+	Timestamp
+*/
+package maintpb
+
+import proto "github.com/golang/protobuf/proto"
+import fmt "fmt"
+import math "math"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
+
+type Mutation struct {
+	GithubIssue *GithubIssueMutation `protobuf:"bytes,1,opt,name=github_issue,json=githubIssue" json:"github_issue,omitempty"`
+}
+
+func (m *Mutation) Reset()                    { *m = Mutation{} }
+func (m *Mutation) String() string            { return proto.CompactTextString(m) }
+func (*Mutation) ProtoMessage()               {}
+func (*Mutation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
+
+func (m *Mutation) GetGithubIssue() *GithubIssueMutation {
+	if m != nil {
+		return m.GithubIssue
+	}
+	return nil
+}
+
+type GithubIssueMutation struct {
+	Owner   string                        `protobuf:"bytes,1,opt,name=owner" json:"owner,omitempty"`
+	Repo    string                        `protobuf:"bytes,2,opt,name=repo" json:"repo,omitempty"`
+	Number  int32                         `protobuf:"varint,3,opt,name=number" json:"number,omitempty"`
+	User    *GithubUser                   `protobuf:"bytes,4,opt,name=user" json:"user,omitempty"`
+	Created *Timestamp                    `protobuf:"bytes,5,opt,name=created" json:"created,omitempty"`
+	Updated *Timestamp                    `protobuf:"bytes,6,opt,name=updated" json:"updated,omitempty"`
+	Body    string                        `protobuf:"bytes,7,opt,name=body" json:"body,omitempty"`
+	Comment []*GithubIssueCommentMutation `protobuf:"bytes,8,rep,name=comment" json:"comment,omitempty"`
+}
+
+func (m *GithubIssueMutation) Reset()                    { *m = GithubIssueMutation{} }
+func (m *GithubIssueMutation) String() string            { return proto.CompactTextString(m) }
+func (*GithubIssueMutation) ProtoMessage()               {}
+func (*GithubIssueMutation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
+
+func (m *GithubIssueMutation) GetOwner() string {
+	if m != nil {
+		return m.Owner
+	}
+	return ""
+}
+
+func (m *GithubIssueMutation) GetRepo() string {
+	if m != nil {
+		return m.Repo
+	}
+	return ""
+}
+
+func (m *GithubIssueMutation) GetNumber() int32 {
+	if m != nil {
+		return m.Number
+	}
+	return 0
+}
+
+func (m *GithubIssueMutation) GetUser() *GithubUser {
+	if m != nil {
+		return m.User
+	}
+	return nil
+}
+
+func (m *GithubIssueMutation) GetCreated() *Timestamp {
+	if m != nil {
+		return m.Created
+	}
+	return nil
+}
+
+func (m *GithubIssueMutation) GetUpdated() *Timestamp {
+	if m != nil {
+		return m.Updated
+	}
+	return nil
+}
+
+func (m *GithubIssueMutation) GetBody() string {
+	if m != nil {
+		return m.Body
+	}
+	return ""
+}
+
+func (m *GithubIssueMutation) GetComment() []*GithubIssueCommentMutation {
+	if m != nil {
+		return m.Comment
+	}
+	return nil
+}
+
+type GithubIssueCommentMutation struct {
+	Id      int64       `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
+	User    *GithubUser `protobuf:"bytes,2,opt,name=user" json:"user,omitempty"`
+	Body    string      `protobuf:"bytes,3,opt,name=body" json:"body,omitempty"`
+	Created *Timestamp  `protobuf:"bytes,4,opt,name=created" json:"created,omitempty"`
+	Updated *Timestamp  `protobuf:"bytes,5,opt,name=updated" json:"updated,omitempty"`
+}
+
+func (m *GithubIssueCommentMutation) Reset()                    { *m = GithubIssueCommentMutation{} }
+func (m *GithubIssueCommentMutation) String() string            { return proto.CompactTextString(m) }
+func (*GithubIssueCommentMutation) ProtoMessage()               {}
+func (*GithubIssueCommentMutation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
+
+func (m *GithubIssueCommentMutation) GetId() int64 {
+	if m != nil {
+		return m.Id
+	}
+	return 0
+}
+
+func (m *GithubIssueCommentMutation) GetUser() *GithubUser {
+	if m != nil {
+		return m.User
+	}
+	return nil
+}
+
+func (m *GithubIssueCommentMutation) GetBody() string {
+	if m != nil {
+		return m.Body
+	}
+	return ""
+}
+
+func (m *GithubIssueCommentMutation) GetCreated() *Timestamp {
+	if m != nil {
+		return m.Created
+	}
+	return nil
+}
+
+func (m *GithubIssueCommentMutation) GetUpdated() *Timestamp {
+	if m != nil {
+		return m.Updated
+	}
+	return nil
+}
+
+type GithubUser struct {
+	Id    int64  `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
+	Login string `protobuf:"bytes,2,opt,name=login" json:"login,omitempty"`
+}
+
+func (m *GithubUser) Reset()                    { *m = GithubUser{} }
+func (m *GithubUser) String() string            { return proto.CompactTextString(m) }
+func (*GithubUser) ProtoMessage()               {}
+func (*GithubUser) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
+
+func (m *GithubUser) GetId() int64 {
+	if m != nil {
+		return m.Id
+	}
+	return 0
+}
+
+func (m *GithubUser) GetLogin() string {
+	if m != nil {
+		return m.Login
+	}
+	return ""
+}
+
+// Timestamp is a copy of the protobuf well-known Timestamp.
+// TODO: use the official one, after figuring out the protoc command line
+// chicanery.
+type Timestamp struct {
+	// Represents seconds of UTC time since Unix epoch
+	// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
+	// 9999-12-31T23:59:59Z inclusive.
+	Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
+	// Non-negative fractions of a second at nanosecond resolution. Negative
+	// second values with fractions must still have non-negative nanos values
+	// that count forward in time. Must be from 0 to 999,999,999
+	// inclusive.
+	Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
+}
+
+func (m *Timestamp) Reset()                    { *m = Timestamp{} }
+func (m *Timestamp) String() string            { return proto.CompactTextString(m) }
+func (*Timestamp) ProtoMessage()               {}
+func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
+
+func (m *Timestamp) GetSeconds() int64 {
+	if m != nil {
+		return m.Seconds
+	}
+	return 0
+}
+
+func (m *Timestamp) GetNanos() int32 {
+	if m != nil {
+		return m.Nanos
+	}
+	return 0
+}
+
+func init() {
+	proto.RegisterType((*Mutation)(nil), "maintpb.Mutation")
+	proto.RegisterType((*GithubIssueMutation)(nil), "maintpb.GithubIssueMutation")
+	proto.RegisterType((*GithubIssueCommentMutation)(nil), "maintpb.GithubIssueCommentMutation")
+	proto.RegisterType((*GithubUser)(nil), "maintpb.GithubUser")
+	proto.RegisterType((*Timestamp)(nil), "maintpb.Timestamp")
+}
+
+func init() { proto.RegisterFile("maintner.proto", fileDescriptor0) }
+
+var fileDescriptor0 = []byte{
+	// 341 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcd, 0x4a, 0xfb, 0x40,
+	0x14, 0xc5, 0xc9, 0x57, 0xd3, 0xde, 0xfe, 0xe9, 0x62, 0x5a, 0xfe, 0x0c, 0xe2, 0xa2, 0xc4, 0x85,
+	0x5d, 0x48, 0x17, 0x75, 0x29, 0xe2, 0xc2, 0x85, 0x88, 0xb8, 0x19, 0x74, 0x2d, 0x49, 0x73, 0xa9,
+	0x03, 0x66, 0x26, 0xcc, 0x4c, 0x10, 0x9f, 0xca, 0xa7, 0xf0, 0xbd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xb3, 0x7d,
+	0x75, 0xdd, 0x36, 0x48, 0xdf, 0x5a, 0xe7, 0x49, 0xbe, 0x3c, 0x38, 0x39, 0xcc, 0xb1, 0x09, 0xf8,
+	0x32, 0xa7, 0xd6, 0x02, 0xe1, 0xcb, 0xbc, 0xaf, 0xc1, 0x3f, 0x56, 0x43, 0x17, 0x35, 0xd8, 0x89,
+	0xba, 0x53, 0x4d, 0xf8, 0xa7, 0x6a, 0xa2, 0xa3, 0xd5, 0x24, 0x2b, 0x80, 0x6d, 0x86, 0x5f, 0xb1,
+	0x67, 0x10, 0xbd, 0xe9, 0x8d, 0x54, 0xed, 0xa7, 0x6e, 0x44, 0x72, 0x05, 0xa3, 0xfe, 0x12, 0xe3,
+	0x10, 0x5b, 0x5c, 0x6b, 0x95, 0xdb, 0xd6, 0xd7, 0xc9, 0xda, 0xac, 0x52, 0xa5, 0x2d, 0x99, 0x23,
+	0xd1, 0x88, 0x6c, 0x40, 0xff, 0xf1, 0xe5, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3b, 0xfd, 0x62,
+	0x8b, 0xd9, 0x02, 0x00, 0x00,
+}
diff --git a/maintner/maintpb/maintner.proto b/maintner/maintpb/maintner.proto
new file mode 100644
index 0000000..e280cf0
--- /dev/null
+++ b/maintner/maintpb/maintner.proto
@@ -0,0 +1,53 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+syntax = "proto3";
+
+package maintpb;
+
+message Mutation {
+  GithubIssueMutation github_issue = 1;
+}
+
+message GithubIssueMutation {
+  string owner = 1;  // "golang"
+  string repo = 2;  // "go"
+  int32 number = 3;  // 1, 2, 3... (not the ID)
+
+  GithubUser user = 4;   // only set for new/updated issues, not new comments
+  Timestamp created = 5; // only needed on new issues
+  Timestamp updated = 6; // only set on updated issue text
+  string body = 7; // for new or updated issue text (top post, which isn't a comment)
+
+  repeated GithubIssueCommentMutation comment = 8;
+}
+
+message GithubIssueCommentMutation {
+  int64 id = 1;
+  GithubUser user = 2;
+  string body = 3;
+  Timestamp created = 4;
+  Timestamp updated = 5;
+}
+
+message GithubUser {
+  int64 id = 1;
+  string login = 2;
+}
+
+// Timestamp is a copy of the protobuf well-known Timestamp.
+// TODO: use the official one, after figuring out the protoc command line
+// chicanery.
+message Timestamp {
+  // Represents seconds of UTC time since Unix epoch
+  // 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
+  // 9999-12-31T23:59:59Z inclusive.
+  int64 seconds = 1;
+
+  // Non-negative fractions of a second at nanosecond resolution. Negative
+  // second values with fractions must still have non-negative nanos values
+  // that count forward in time. Must be from 0 to 999,999,999
+  // inclusive.
+  int32 nanos = 2;
+}
diff --git a/maintner/maintpb/maintpb.go b/maintner/maintpb/maintpb.go
new file mode 100644
index 0000000..8c538b2
--- /dev/null
+++ b/maintner/maintpb/maintpb.go
@@ -0,0 +1,10 @@
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package maintpb
+
+// See https://github.com/golang/protobuf#installation and
+// then run "go generate" in this directory to update.
+
+//go:generate protoc --go_out=plugins=grpc:. maintner.proto