forked from nytimes/gizmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nyt-proxy.pb.go
201 lines (170 loc) · 7.39 KB
/
nyt-proxy.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
// Code generated by protoc-gen-go.
// source: nyt-proxy.proto
// DO NOT EDIT!
/*
Package service is a generated protocol buffer package.
It is generated from these files:
nyt-proxy.proto
It has these top-level messages:
MostPopularRequest
MostPopularResponse
CatsRequest
CatsResponse
*/
package service
import (
"fmt"
"math"
"github.com/NYTimes/gizmo/examples/nyt"
proto "github.com/golang/protobuf/proto"
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
type MostPopularRequest struct {
ResourceType string `protobuf:"bytes,1,opt,name=resourceType" json:"resourceType,omitempty"`
Section string `protobuf:"bytes,2,opt,name=section" json:"section,omitempty"`
TimePeriodDays uint32 `protobuf:"varint,3,opt,name=timePeriodDays" json:"timePeriodDays,omitempty"`
}
func (m *MostPopularRequest) Reset() { *m = MostPopularRequest{} }
func (m *MostPopularRequest) String() string { return proto.CompactTextString(m) }
func (*MostPopularRequest) ProtoMessage() {}
func (*MostPopularRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
type MostPopularResponse struct {
Result []*nyt.MostPopularResult `protobuf:"bytes,1,rep,name=result" json:"result,omitempty"`
}
func (m *MostPopularResponse) Reset() { *m = MostPopularResponse{} }
func (m *MostPopularResponse) String() string { return proto.CompactTextString(m) }
func (*MostPopularResponse) ProtoMessage() {}
func (*MostPopularResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *MostPopularResponse) GetResult() []*nyt.MostPopularResult {
if m != nil {
return m.Result
}
return nil
}
type CatsRequest struct {
}
func (m *CatsRequest) Reset() { *m = CatsRequest{} }
func (m *CatsRequest) String() string { return proto.CompactTextString(m) }
func (*CatsRequest) ProtoMessage() {}
func (*CatsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
type CatsResponse struct {
Results []*nyt.SemanticConceptArticle `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"`
}
func (m *CatsResponse) Reset() { *m = CatsResponse{} }
func (m *CatsResponse) String() string { return proto.CompactTextString(m) }
func (*CatsResponse) ProtoMessage() {}
func (*CatsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *CatsResponse) GetResults() []*nyt.SemanticConceptArticle {
if m != nil {
return m.Results
}
return nil
}
func init() {
proto.RegisterType((*MostPopularRequest)(nil), "service.MostPopularRequest")
proto.RegisterType((*MostPopularResponse)(nil), "service.MostPopularResponse")
proto.RegisterType((*CatsRequest)(nil), "service.CatsRequest")
proto.RegisterType((*CatsResponse)(nil), "service.CatsResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// Client API for NYTProxyService service
type NYTProxyServiceClient interface {
GetMostPopular(ctx context.Context, in *MostPopularRequest, opts ...grpc.CallOption) (*MostPopularResponse, error)
GetCats(ctx context.Context, in *CatsRequest, opts ...grpc.CallOption) (*CatsResponse, error)
}
type nYTProxyServiceClient struct {
cc *grpc.ClientConn
}
func NewNYTProxyServiceClient(cc *grpc.ClientConn) NYTProxyServiceClient {
return &nYTProxyServiceClient{cc}
}
func (c *nYTProxyServiceClient) GetMostPopular(ctx context.Context, in *MostPopularRequest, opts ...grpc.CallOption) (*MostPopularResponse, error) {
out := new(MostPopularResponse)
err := grpc.Invoke(ctx, "/service.NYTProxyService/GetMostPopular", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *nYTProxyServiceClient) GetCats(ctx context.Context, in *CatsRequest, opts ...grpc.CallOption) (*CatsResponse, error) {
out := new(CatsResponse)
err := grpc.Invoke(ctx, "/service.NYTProxyService/GetCats", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for NYTProxyService service
type NYTProxyServiceServer interface {
GetMostPopular(context.Context, *MostPopularRequest) (*MostPopularResponse, error)
GetCats(context.Context, *CatsRequest) (*CatsResponse, error)
}
func RegisterNYTProxyServiceServer(s *grpc.Server, srv NYTProxyServiceServer) {
s.RegisterService(&NYTProxyService_serviceDesc, srv)
}
func _NYTProxyService_GetMostPopular_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(MostPopularRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(NYTProxyServiceServer).GetMostPopular(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _NYTProxyService_GetCats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(CatsRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(NYTProxyServiceServer).GetCats(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
var NYTProxyService_serviceDesc = grpc.ServiceDesc{
ServiceName: "service.NYTProxyService",
HandlerType: (*NYTProxyServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetMostPopular",
Handler: _NYTProxyService_GetMostPopular_Handler,
},
{
MethodName: "GetCats",
Handler: _NYTProxyService_GetCats_Handler,
},
},
Streams: []grpc.StreamDesc{},
}
var fileDescriptor0 = []byte{
// 298 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4a, 0xf3, 0x40,
0x14, 0xc5, 0xc9, 0x57, 0x68, 0xf8, 0x6e, 0xff, 0x04, 0xc6, 0xb6, 0xc4, 0xd4, 0x85, 0x64, 0x21,
0x5d, 0x68, 0x84, 0x0a, 0xae, 0x74, 0x21, 0x15, 0x5c, 0x88, 0x12, 0x4c, 0x37, 0x2e, 0xe3, 0x78,
0x17, 0x81, 0x24, 0x33, 0xce, 0x4c, 0xc4, 0xbc, 0x88, 0xcf, 0xeb, 0x4d, 0x66, 0x90, 0x56, 0xdd,
0x84, 0xe4, 0x9e, 0x93, 0xdf, 0x9c, 0x7b, 0x06, 0x82, 0xba, 0x35, 0x67, 0x52, 0x89, 0x8f, 0x36,
0xa1, 0xa7, 0x11, 0xcc, 0xd7, 0xa8, 0xde, 0x0b, 0x8e, 0xd1, 0x9c, 0x94, 0xf3, 0x4a, 0x68, 0x23,
0x85, 0x6c, 0xca, 0x5c, 0x59, 0x3d, 0x3a, 0xec, 0xc6, 0x1a, 0xab, 0xbc, 0x36, 0x05, 0xe7, 0xa2,
0xe6, 0x28, 0x8d, 0x95, 0xe2, 0x0c, 0xd8, 0x03, 0xf9, 0x53, 0xeb, 0x7f, 0xc2, 0xb7, 0x06, 0xb5,
0x61, 0x33, 0x18, 0x2b, 0xd4, 0xa2, 0x51, 0x1c, 0xb7, 0xad, 0xc4, 0xd0, 0x3b, 0xf6, 0x56, 0xff,
0x59, 0x00, 0x74, 0x10, 0x37, 0x85, 0xa8, 0xc3, 0x7f, 0xfd, 0x60, 0x01, 0x53, 0x53, 0x54, 0x98,
0xa2, 0x2a, 0xc4, 0xeb, 0x6d, 0xde, 0xea, 0x70, 0x40, 0xf3, 0x49, 0x7c, 0x0d, 0x07, 0x7b, 0x50,
0x2d, 0x45, 0xad, 0x91, 0x9d, 0xc0, 0x90, 0xa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