forked from pydio/cells
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.micro.go
226 lines (188 loc) · 5.49 KB
/
common.micro.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
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: common.proto
/*
Package service is a generated protocol buffer package.
It is generated from these files:
common.proto
It has these top-level messages:
Query
ResourcePolicyQuery
ResourcePolicy
ActionOutputQuery
SourceSingleQuery
StopEvent
StatusResponse
ChangesArchiveQuery
*/
package service
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/golang/protobuf/ptypes/any"
import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
import (
client "github.com/micro/go-micro/client"
server "github.com/micro/go-micro/server"
context "context"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = google_protobuf1.Empty{}
// 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
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option
// Client API for Starter service
type StarterService interface {
Start(ctx context.Context, in *google_protobuf1.Empty, opts ...client.CallOption) (*google_protobuf1.Empty, error)
}
type starterService struct {
c client.Client
name string
}
func NewStarterService(name string, c client.Client) StarterService {
if c == nil {
c = client.NewClient()
}
if len(name) == 0 {
name = "service"
}
return &starterService{
c: c,
name: name,
}
}
func (c *starterService) Start(ctx context.Context, in *google_protobuf1.Empty, opts ...client.CallOption) (*google_protobuf1.Empty, error) {
req := c.c.NewRequest(c.name, "Starter.Start", in)
out := new(google_protobuf1.Empty)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Starter service
type StarterHandler interface {
Start(context.Context, *google_protobuf1.Empty, *google_protobuf1.Empty) error
}
func RegisterStarterHandler(s server.Server, hdlr StarterHandler, opts ...server.HandlerOption) error {
type starter interface {
Start(ctx context.Context, in *google_protobuf1.Empty, out *google_protobuf1.Empty) error
}
type Starter struct {
starter
}
h := &starterHandler{hdlr}
return s.Handle(s.NewHandler(&Starter{h}, opts...))
}
type starterHandler struct {
StarterHandler
}
func (h *starterHandler) Start(ctx context.Context, in *google_protobuf1.Empty, out *google_protobuf1.Empty) error {
return h.StarterHandler.Start(ctx, in, out)
}
// Client API for Service service
type Service interface {
Status(ctx context.Context, in *google_protobuf1.Empty, opts ...client.CallOption) (*StatusResponse, error)
}
type service struct {
c client.Client
name string
}
func NewService(name string, c client.Client) Service {
if c == nil {
c = client.NewClient()
}
if len(name) == 0 {
name = "service"
}
return &service{
c: c,
name: name,
}
}
func (c *service) Status(ctx context.Context, in *google_protobuf1.Empty, opts ...client.CallOption) (*StatusResponse, error) {
req := c.c.NewRequest(c.name, "Service.Status", in)
out := new(StatusResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Service service
type ServiceHandler interface {
Status(context.Context, *google_protobuf1.Empty, *StatusResponse) error
}
func RegisterServiceHandler(s server.Server, hdlr ServiceHandler, opts ...server.HandlerOption) error {
type service interface {
Status(ctx context.Context, in *google_protobuf1.Empty, out *StatusResponse) error
}
type Service struct {
service
}
h := &serviceHandler{hdlr}
return s.Handle(s.NewHandler(&Service{h}, opts...))
}
type serviceHandler struct {
ServiceHandler
}
func (h *serviceHandler) Status(ctx context.Context, in *google_protobuf1.Empty, out *StatusResponse) error {
return h.ServiceHandler.Status(ctx, in, out)
}
// Client API for Archiver service
type ArchiverService interface {
Archive(ctx context.Context, in *Query, opts ...client.CallOption) (*StatusResponse, error)
}
type archiverService struct {
c client.Client
name string
}
func NewArchiverService(name string, c client.Client) ArchiverService {
if c == nil {
c = client.NewClient()
}
if len(name) == 0 {
name = "service"
}
return &archiverService{
c: c,
name: name,
}
}
func (c *archiverService) Archive(ctx context.Context, in *Query, opts ...client.CallOption) (*StatusResponse, error) {
req := c.c.NewRequest(c.name, "Archiver.Archive", in)
out := new(StatusResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Archiver service
type ArchiverHandler interface {
Archive(context.Context, *Query, *StatusResponse) error
}
func RegisterArchiverHandler(s server.Server, hdlr ArchiverHandler, opts ...server.HandlerOption) error {
type archiver interface {
Archive(ctx context.Context, in *Query, out *StatusResponse) error
}
type Archiver struct {
archiver
}
h := &archiverHandler{hdlr}
return s.Handle(s.NewHandler(&Archiver{h}, opts...))
}
type archiverHandler struct {
ArchiverHandler
}
func (h *archiverHandler) Archive(ctx context.Context, in *Query, out *StatusResponse) error {
return h.ArchiverHandler.Archive(ctx, in, out)
}