Serve package list as plain text by default
[debiancodesearch.git] / proto / sourcebackend.pb.go
blob01989f3d79211d29bba313106c5227a633a30439
1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: sourcebackend.proto
4 package proto
6 import proto1 "github.com/golang/protobuf/proto"
7 import fmt "fmt"
8 import math "math"
10 import (
11 context "golang.org/x/net/context"
12 grpc "google.golang.org/grpc"
15 // Reference imports to suppress errors if they are not otherwise used.
16 var _ = proto1.Marshal
17 var _ = fmt.Errorf
18 var _ = math.Inf
20 type SearchReply_Type int32
22 const (
23 SearchReply_MATCH SearchReply_Type = 0
24 SearchReply_PROGRESS_UPDATE SearchReply_Type = 1
27 var SearchReply_Type_name = map[int32]string{
28 0: "MATCH",
29 1: "PROGRESS_UPDATE",
31 var SearchReply_Type_value = map[string]int32{
32 "MATCH": 0,
33 "PROGRESS_UPDATE": 1,
36 func (x SearchReply_Type) String() string {
37 return proto1.EnumName(SearchReply_Type_name, int32(x))
39 func (SearchReply_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{5, 0} }
41 type FileRequest struct {
42 Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
45 func (m *FileRequest) Reset() { *m = FileRequest{} }
46 func (m *FileRequest) String() string { return proto1.CompactTextString(m) }
47 func (*FileRequest) ProtoMessage() {}
48 func (*FileRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
50 func (m *FileRequest) GetPath() string {
51 if m != nil {
52 return m.Path
54 return ""
57 type FileReply struct {
58 Contents []byte `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"`
61 func (m *FileReply) Reset() { *m = FileReply{} }
62 func (m *FileReply) String() string { return proto1.CompactTextString(m) }
63 func (*FileReply) ProtoMessage() {}
64 func (*FileReply) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
66 func (m *FileReply) GetContents() []byte {
67 if m != nil {
68 return m.Contents
70 return nil
73 type SearchRequest struct {
74 Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"`
75 // Rewritten URL (after RewriteQuery()) with all the parameters that
76 // are relevant for ranking.
77 RewrittenUrl string `protobuf:"bytes,2,opt,name=rewritten_url,json=rewrittenUrl" json:"rewritten_url,omitempty"`
80 func (m *SearchRequest) Reset() { *m = SearchRequest{} }
81 func (m *SearchRequest) String() string { return proto1.CompactTextString(m) }
82 func (*SearchRequest) ProtoMessage() {}
83 func (*SearchRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
85 func (m *SearchRequest) GetQuery() string {
86 if m != nil {
87 return m.Query
89 return ""
92 func (m *SearchRequest) GetRewrittenUrl() string {
93 if m != nil {
94 return m.RewrittenUrl
96 return ""
99 type Match struct {
100 Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
101 Line uint32 `protobuf:"varint,2,opt,name=line" json:"line,omitempty"`
102 // Contents of line-2.
103 Ctxp2 string `protobuf:"bytes,3,opt,name=ctxp2" json:"ctxp2,omitempty"`
104 // Contents of line-1.
105 Ctxp1 string `protobuf:"bytes,4,opt,name=ctxp1" json:"ctxp1,omitempty"`
106 // Contents of the line containing the match.
107 Context string `protobuf:"bytes,5,opt,name=context" json:"context,omitempty"`
108 // Contents of line+1.
109 Ctxn1 string `protobuf:"bytes,6,opt,name=ctxn1" json:"ctxn1,omitempty"`
110 // Contents of line+2.
111 Ctxn2 string `protobuf:"bytes,7,opt,name=ctxn2" json:"ctxn2,omitempty"`
112 Pathrank float32 `protobuf:"fixed32,8,opt,name=pathrank" json:"pathrank,omitempty"`
113 Ranking float32 `protobuf:"fixed32,9,opt,name=ranking" json:"ranking,omitempty"`
114 Package string `protobuf:"bytes,10,opt,name=package" json:"package,omitempty"`
117 func (m *Match) Reset() { *m = Match{} }
118 func (m *Match) String() string { return proto1.CompactTextString(m) }
119 func (*Match) ProtoMessage() {}
120 func (*Match) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} }
122 func (m *Match) GetPath() string {
123 if m != nil {
124 return m.Path
126 return ""
129 func (m *Match) GetLine() uint32 {
130 if m != nil {
131 return m.Line
133 return 0
136 func (m *Match) GetCtxp2() string {
137 if m != nil {
138 return m.Ctxp2
140 return ""
143 func (m *Match) GetCtxp1() string {
144 if m != nil {
145 return m.Ctxp1
147 return ""
150 func (m *Match) GetContext() string {
151 if m != nil {
152 return m.Context
154 return ""
157 func (m *Match) GetCtxn1() string {
158 if m != nil {
159 return m.Ctxn1
161 return ""
164 func (m *Match) GetCtxn2() string {
165 if m != nil {
166 return m.Ctxn2
168 return ""
171 func (m *Match) GetPathrank() float32 {
172 if m != nil {
173 return m.Pathrank
175 return 0
178 func (m *Match) GetRanking() float32 {
179 if m != nil {
180 return m.Ranking
182 return 0
185 func (m *Match) GetPackage() string {
186 if m != nil {
187 return m.Package
189 return ""
192 type ProgressUpdate struct {
193 FilesProcessed uint64 `protobuf:"varint,1,opt,name=files_processed,json=filesProcessed" json:"files_processed,omitempty"`
194 FilesTotal uint64 `protobuf:"varint,2,opt,name=files_total,json=filesTotal" json:"files_total,omitempty"`
197 func (m *ProgressUpdate) Reset() { *m = ProgressUpdate{} }
198 func (m *ProgressUpdate) String() string { return proto1.CompactTextString(m) }
199 func (*ProgressUpdate) ProtoMessage() {}
200 func (*ProgressUpdate) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} }
202 func (m *ProgressUpdate) GetFilesProcessed() uint64 {
203 if m != nil {
204 return m.FilesProcessed
206 return 0
209 func (m *ProgressUpdate) GetFilesTotal() uint64 {
210 if m != nil {
211 return m.FilesTotal
213 return 0
216 type SearchReply struct {
217 Type SearchReply_Type `protobuf:"varint,1,opt,name=type,enum=proto.SearchReply_Type" json:"type,omitempty"`
218 Match *Match `protobuf:"bytes,2,opt,name=match" json:"match,omitempty"`
219 ProgressUpdate *ProgressUpdate `protobuf:"bytes,3,opt,name=progress_update,json=progressUpdate" json:"progress_update,omitempty"`
222 func (m *SearchReply) Reset() { *m = SearchReply{} }
223 func (m *SearchReply) String() string { return proto1.CompactTextString(m) }
224 func (*SearchReply) ProtoMessage() {}
225 func (*SearchReply) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} }
227 func (m *SearchReply) GetType() SearchReply_Type {
228 if m != nil {
229 return m.Type
231 return SearchReply_MATCH
234 func (m *SearchReply) GetMatch() *Match {
235 if m != nil {
236 return m.Match
238 return nil
241 func (m *SearchReply) GetProgressUpdate() *ProgressUpdate {
242 if m != nil {
243 return m.ProgressUpdate
245 return nil
248 func init() {
249 proto1.RegisterType((*FileRequest)(nil), "proto.FileRequest")
250 proto1.RegisterType((*FileReply)(nil), "proto.FileReply")
251 proto1.RegisterType((*SearchRequest)(nil), "proto.SearchRequest")
252 proto1.RegisterType((*Match)(nil), "proto.Match")
253 proto1.RegisterType((*ProgressUpdate)(nil), "proto.ProgressUpdate")
254 proto1.RegisterType((*SearchReply)(nil), "proto.SearchReply")
255 proto1.RegisterEnum("proto.SearchReply_Type", SearchReply_Type_name, SearchReply_Type_value)
258 // Reference imports to suppress errors if they are not otherwise used.
259 var _ context.Context
260 var _ grpc.ClientConn
262 // This is a compile-time assertion to ensure that this generated file
263 // is compatible with the grpc package it is being compiled against.
264 const _ = grpc.SupportPackageIsVersion4
266 // Client API for SourceBackend service
268 type SourceBackendClient interface {
269 // File reads the file and returns its contents.
270 File(ctx context.Context, in *FileRequest, opts ...grpc.CallOption) (*FileReply, error)
271 // Search performs the given query and streams matches/progress updates.
272 Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (SourceBackend_SearchClient, error)
275 type sourceBackendClient struct {
276 cc *grpc.ClientConn
279 func NewSourceBackendClient(cc *grpc.ClientConn) SourceBackendClient {
280 return &sourceBackendClient{cc}
283 func (c *sourceBackendClient) File(ctx context.Context, in *FileRequest, opts ...grpc.CallOption) (*FileReply, error) {
284 out := new(FileReply)
285 err := grpc.Invoke(ctx, "/proto.SourceBackend/File", in, out, c.cc, opts...)
286 if err != nil {
287 return nil, err
289 return out, nil
292 func (c *sourceBackendClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (SourceBackend_SearchClient, error) {
293 stream, err := grpc.NewClientStream(ctx, &_SourceBackend_serviceDesc.Streams[0], c.cc, "/proto.SourceBackend/Search", opts...)
294 if err != nil {
295 return nil, err
297 x := &sourceBackendSearchClient{stream}
298 if err := x.ClientStream.SendMsg(in); err != nil {
299 return nil, err
301 if err := x.ClientStream.CloseSend(); err != nil {
302 return nil, err
304 return x, nil
307 type SourceBackend_SearchClient interface {
308 Recv() (*SearchReply, error)
309 grpc.ClientStream
312 type sourceBackendSearchClient struct {
313 grpc.ClientStream
316 func (x *sourceBackendSearchClient) Recv() (*SearchReply, error) {
317 m := new(SearchReply)
318 if err := x.ClientStream.RecvMsg(m); err != nil {
319 return nil, err
321 return m, nil
324 // Server API for SourceBackend service
326 type SourceBackendServer interface {
327 // File reads the file and returns its contents.
328 File(context.Context, *FileRequest) (*FileReply, error)
329 // Search performs the given query and streams matches/progress updates.
330 Search(*SearchRequest, SourceBackend_SearchServer) error
333 func RegisterSourceBackendServer(s *grpc.Server, srv SourceBackendServer) {
334 s.RegisterService(&_SourceBackend_serviceDesc, srv)
337 func _SourceBackend_File_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
338 in := new(FileRequest)
339 if err := dec(in); err != nil {
340 return nil, err
342 if interceptor == nil {
343 return srv.(SourceBackendServer).File(ctx, in)
345 info := &grpc.UnaryServerInfo{
346 Server: srv,
347 FullMethod: "/proto.SourceBackend/File",
349 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
350 return srv.(SourceBackendServer).File(ctx, req.(*FileRequest))
352 return interceptor(ctx, in, info, handler)
355 func _SourceBackend_Search_Handler(srv interface{}, stream grpc.ServerStream) error {
356 m := new(SearchRequest)
357 if err := stream.RecvMsg(m); err != nil {
358 return err
360 return srv.(SourceBackendServer).Search(m, &sourceBackendSearchServer{stream})
363 type SourceBackend_SearchServer interface {
364 Send(*SearchReply) error
365 grpc.ServerStream
368 type sourceBackendSearchServer struct {
369 grpc.ServerStream
372 func (x *sourceBackendSearchServer) Send(m *SearchReply) error {
373 return x.ServerStream.SendMsg(m)
376 var _SourceBackend_serviceDesc = grpc.ServiceDesc{
377 ServiceName: "proto.SourceBackend",
378 HandlerType: (*SourceBackendServer)(nil),
379 Methods: []grpc.MethodDesc{
381 MethodName: "File",
382 Handler: _SourceBackend_File_Handler,
385 Streams: []grpc.StreamDesc{
387 StreamName: "Search",
388 Handler: _SourceBackend_Search_Handler,
389 ServerStreams: true,
392 Metadata: "sourcebackend.proto",
395 func init() { proto1.RegisterFile("sourcebackend.proto", fileDescriptor1) }
397 var fileDescriptor1 = []byte{
398 // 481 bytes of a gzipped FileDescriptorProto
399 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xdd, 0x6e, 0xd3, 0x4c,
400 0x10, 0x8d, 0xfb, 0xd9, 0x69, 0x33, 0xf9, 0xd5, 0xb6, 0x9f, 0x58, 0xf5, 0x86, 0xb2, 0x48, 0xb4,
401 0x12, 0x52, 0x44, 0x8c, 0xc4, 0x25, 0x52, 0x81, 0x02, 0x42, 0xaa, 0x88, 0x36, 0xc9, 0x0d, 0x37,
402 0x91, 0xeb, 0x0c, 0x89, 0x15, 0x63, 0x6f, 0xd7, 0x6b, 0xb5, 0x7e, 0x41, 0xde, 0x87, 0x37, 0x40,
403 0x3b, 0x6b, 0xa7, 0x0d, 0x70, 0xb5, 0x7b, 0xce, 0x9c, 0x9d, 0x33, 0x3b, 0x33, 0x70, 0x5c, 0xe4,
404 0xa5, 0x8e, 0xf1, 0x26, 0x8a, 0xb7, 0x98, 0xad, 0xc6, 0x4a, 0xe7, 0x26, 0x67, 0x01, 0x1d, 0xe2,
405 0x19, 0x74, 0x3f, 0x26, 0x29, 0x4a, 0xbc, 0x2d, 0xb1, 0x30, 0x8c, 0x81, 0xaf, 0x22, 0xb3, 0xe1,
406 0xde, 0x99, 0x77, 0xd1, 0x91, 0x74, 0x17, 0xe7, 0xd0, 0x71, 0x12, 0x95, 0x56, 0xec, 0x14, 0x8e,
407 0xe2, 0x3c, 0x33, 0x98, 0x99, 0x82, 0x44, 0x3d, 0xb9, 0xc3, 0xe2, 0x0b, 0xf4, 0x67, 0x18, 0xe9,
408 0x78, 0xd3, 0x64, 0x3b, 0x81, 0xe0, 0xb6, 0x44, 0x5d, 0xd5, 0xe9, 0x1c, 0x60, 0xcf, 0xa1, 0xaf,
409 0xf1, 0x4e, 0x27, 0xc6, 0x60, 0xb6, 0x2c, 0x75, 0xca, 0x0f, 0x28, 0xda, 0xdb, 0x91, 0x0b, 0x9d,
410 0x8a, 0x5f, 0x1e, 0x04, 0xd7, 0x91, 0x89, 0x37, 0xff, 0x2a, 0xc9, 0x72, 0x69, 0x92, 0x21, 0xbd,
411 0xec, 0x4b, 0xba, 0x5b, 0xb3, 0xd8, 0xdc, 0xab, 0x90, 0xff, 0xe7, 0xcc, 0x08, 0x34, 0xec, 0x84,
412 0xfb, 0x0f, 0xec, 0x84, 0x71, 0x38, 0xa4, 0xaa, 0xef, 0x0d, 0x0f, 0x88, 0x6f, 0x60, 0xad, 0xcf,
413 0x26, 0xbc, 0xbd, 0xd3, 0x67, 0x93, 0x86, 0x0d, 0xf9, 0xe1, 0x03, 0x1b, 0xda, 0x5e, 0xd8, 0x6a,
414 0x74, 0x94, 0x6d, 0xf9, 0xd1, 0x99, 0x77, 0x71, 0x20, 0x77, 0xd8, 0x3a, 0xd8, 0x33, 0xc9, 0xd6,
415 0xbc, 0x43, 0xa1, 0x06, 0xda, 0x88, 0x8a, 0xe2, 0x6d, 0xb4, 0x46, 0x0e, 0xce, 0xbb, 0x86, 0xe2,
416 0x1b, 0x0c, 0xa6, 0x3a, 0x5f, 0x6b, 0x2c, 0x8a, 0x85, 0x5a, 0x45, 0x06, 0xd9, 0x39, 0x0c, 0xbf,
417 0x27, 0x29, 0x16, 0x4b, 0xa5, 0xf3, 0x18, 0x8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 0x0d, 0x4e, 0x03, 0x00,
429 0x00,