-
Notifications
You must be signed in to change notification settings - Fork 194
/
todo.pb.go
230 lines (194 loc) · 6.8 KB
/
todo.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: todo.proto
/*
Package todo is a generated protocol buffer package.
It is generated from these files:
todo.proto
It has these top-level messages:
Task
TaskList
Text
Void
*/
package todo
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// 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 Task struct {
Text string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"`
Done bool `protobuf:"varint,2,opt,name=done" json:"done,omitempty"`
}
func (m *Task) Reset() { *m = Task{} }
func (m *Task) String() string { return proto.CompactTextString(m) }
func (*Task) ProtoMessage() {}
func (*Task) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *Task) GetText() string {
if m != nil {
return m.Text
}
return ""
}
func (m *Task) GetDone() bool {
if m != nil {
return m.Done
}
return false
}
type TaskList struct {
Tasks []*Task `protobuf:"bytes,1,rep,name=tasks" json:"tasks,omitempty"`
}
func (m *TaskList) Reset() { *m = TaskList{} }
func (m *TaskList) String() string { return proto.CompactTextString(m) }
func (*TaskList) ProtoMessage() {}
func (*TaskList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *TaskList) GetTasks() []*Task {
if m != nil {
return m.Tasks
}
return nil
}
type Text struct {
Text string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"`
}
func (m *Text) Reset() { *m = Text{} }
func (m *Text) String() string { return proto.CompactTextString(m) }
func (*Text) ProtoMessage() {}
func (*Text) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *Text) GetText() string {
if m != nil {
return m.Text
}
return ""
}
type Void struct {
}
func (m *Void) Reset() { *m = Void{} }
func (m *Void) String() string { return proto.CompactTextString(m) }
func (*Void) ProtoMessage() {}
func (*Void) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func init() {
proto.RegisterType((*Task)(nil), "todo.Task")
proto.RegisterType((*TaskList)(nil), "todo.TaskList")
proto.RegisterType((*Text)(nil), "todo.Text")
proto.RegisterType((*Void)(nil), "todo.Void")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Tasks service
type TasksClient interface {
List(ctx context.Context, in *Void, opts ...grpc.CallOption) (*TaskList, error)
Add(ctx context.Context, in *Text, opts ...grpc.CallOption) (*Task, error)
}
type tasksClient struct {
cc *grpc.ClientConn
}
func NewTasksClient(cc *grpc.ClientConn) TasksClient {
return &tasksClient{cc}
}
func (c *tasksClient) List(ctx context.Context, in *Void, opts ...grpc.CallOption) (*TaskList, error) {
out := new(TaskList)
err := grpc.Invoke(ctx, "/todo.Tasks/List", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *tasksClient) Add(ctx context.Context, in *Text, opts ...grpc.CallOption) (*Task, error) {
out := new(Task)
err := grpc.Invoke(ctx, "/todo.Tasks/Add", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Tasks service
type TasksServer interface {
List(context.Context, *Void) (*TaskList, error)
Add(context.Context, *Text) (*Task, error)
}
func RegisterTasksServer(s *grpc.Server, srv TasksServer) {
s.RegisterService(&_Tasks_serviceDesc, srv)
}
func _Tasks_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Void)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TasksServer).List(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/todo.Tasks/List",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TasksServer).List(ctx, req.(*Void))
}
return interceptor(ctx, in, info, handler)
}
func _Tasks_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Text)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TasksServer).Add(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/todo.Tasks/Add",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TasksServer).Add(ctx, req.(*Text))
}
return interceptor(ctx, in, info, handler)
}
var _Tasks_serviceDesc = grpc.ServiceDesc{
ServiceName: "todo.Tasks",
HandlerType: (*TasksServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "List",
Handler: _Tasks_List_Handler,
},
{
MethodName: "Add",
Handler: _Tasks_Add_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "todo.proto",
}
func init() { proto.RegisterFile("todo.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 178 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x8f, 0xb1, 0xaa, 0xc2, 0x40,
0x10, 0x45, 0xb3, 0x2f, 0x9b, 0x90, 0x77, 0x05, 0x8b, 0xad, 0x42, 0x1a, 0x97, 0xc5, 0x22, 0x85,
0xa4, 0x88, 0x5f, 0x60, 0x2f, 0x16, 0x21, 0xd8, 0x47, 0x36, 0x45, 0x08, 0x38, 0xe2, 0x4e, 0xe1,
0xe7, 0xcb, 0xac, 0x11, 0xc5, 0xee, 0x32, 0xe7, 0xce, 0x19, 0x06, 0x60, 0xf2, 0xd4, 0xdc, 0xee,
0xc4, 0x64, 0xb4, 0x64, 0xd7, 0x40, 0xf7, 0x43, 0x98, 0x8d, 0x81, 0xe6, 0xf1, 0xc1, 0xa5, 0xb2,
0xaa, 0xfe, 0xef, 0x62, 0x96, 0x99, 0xa7, 0xeb, 0x58, 0xfe, 0x59, 0x55, 0x17, 0x5d, 0xcc, 0x6e,
0x87, 0x42, 0xfa, 0xc7, 0x29, 0xb0, 0xb1, 0xc8, 0x78, 0x08, 0x73, 0x28, 0x95, 0x4d, 0xeb, 0x55,
0x8b, 0x26, 0xda, 0x05, 0x77, 0x2f, 0xe0, 0x2a, 0xe8, 0x7e, 0x31, 0xfd, 0xda, 0x5d, 0x0e, 0x7d,
0xa6, 0xc9, 0xb7, 0x27, 0x64, 0xb2, 0x12, 0xcc, 0x16, 0x3a, 0x6a, 0x17, 0x8f, 0xc0, 0x6a, 0xfd,
0x71, 0x0a, 0x73, 0x89, 0xd9, 0x20, 0x3d, 0x78, 0xff, 0x2e, 0x89, 0xbd, 0xfa, 0x3a, 0xec, 0x92,
0x4b, 0x1e, 0xdf, 0xdb, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xd0, 0xad, 0xd6, 0x8c, 0xec, 0x00,
0x00, 0x00,
}