-
Notifications
You must be signed in to change notification settings - Fork 171
/
cells-docstore_grpc.stub.pb.go
85 lines (78 loc) · 2.38 KB
/
cells-docstore_grpc.stub.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
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-client-stub v1.1.0
// - protoc v3.18.1
// source: cells-docstore.proto
package docstore
import (
context "context"
fmt "fmt"
stubs "github.com/pydio/cells/v4/common/server/stubs"
grpc "google.golang.org/grpc"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
type DocStoreStub struct {
DocStoreServer
}
func (s *DocStoreStub) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error {
fmt.Println("Serving", method, args, reply, opts)
var e error
switch method {
case "/docstore.DocStore/PutDocument":
resp, er := s.DocStoreServer.PutDocument(ctx, args.(*PutDocumentRequest))
if er == nil {
e = stubs.AssignToInterface(resp, reply)
} else {
e = er
}
case "/docstore.DocStore/GetDocument":
resp, er := s.DocStoreServer.GetDocument(ctx, args.(*GetDocumentRequest))
if er == nil {
e = stubs.AssignToInterface(resp, reply)
} else {
e = er
}
case "/docstore.DocStore/DeleteDocuments":
resp, er := s.DocStoreServer.DeleteDocuments(ctx, args.(*DeleteDocumentsRequest))
if er == nil {
e = stubs.AssignToInterface(resp, reply)
} else {
e = er
}
case "/docstore.DocStore/CountDocuments":
resp, er := s.DocStoreServer.CountDocuments(ctx, args.(*ListDocumentsRequest))
if er == nil {
e = stubs.AssignToInterface(resp, reply)
} else {
e = er
}
default:
e = fmt.Errorf(method + " not implemented")
}
return e
}
func (s *DocStoreStub) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error) {
fmt.Println("Serving", method)
switch method {
case "/docstore.DocStore/ListDocuments":
st := &DocStoreStub_ListDocumentsStreamer{}
st.Init(ctx, func(i interface{}) error {
defer func() {
close(st.RespChan)
}()
return s.DocStoreServer.ListDocuments(i.(*ListDocumentsRequest), st)
})
return st, nil
}
return nil, fmt.Errorf(method + " not implemented")
}
type DocStoreStub_ListDocumentsStreamer struct {
stubs.ClientServerStreamerCore
}
func (s *DocStoreStub_ListDocumentsStreamer) Send(response *ListDocumentsResponse) error {
s.RespChan <- response
return nil
}