blob: 102699be61c5f528b671e5355a43432e88765f06 [file] [log] [blame]
Himabindu Puchafb26a832015-05-20 15:37:50 -07001// Copyright 2015 The Vanadium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// This file was auto-generated by the vanadium vdl tool.
6// Source: sync.vdl
7
Himabindu Puchaf9ec56f2015-06-02 11:34:05 -07008package interfaces
Himabindu Puchafb26a832015-05-20 15:37:50 -07009
10import (
11 // VDL system imports
Himabindu Pucha03ef3932015-06-26 17:56:09 -070012 "io"
Himabindu Puchafb26a832015-05-20 15:37:50 -070013 "v.io/v23"
14 "v.io/v23/context"
Raja Daoud52851362015-09-14 15:50:40 -070015 "v.io/v23/i18n"
Himabindu Puchafb26a832015-05-20 15:37:50 -070016 "v.io/v23/rpc"
Sergey Rogulenkoc2e60f62015-06-23 14:50:58 -070017 "v.io/v23/vdl"
Raja Daoud52851362015-09-14 15:50:40 -070018 "v.io/v23/verror"
Himabindu Pucha12e1a122015-06-08 15:59:09 -070019
20 // VDL user imports
Sergey Rogulenkoc2e60f62015-06-23 14:50:58 -070021 "v.io/v23/security/access"
Adam Sadovskyf2efeb52015-08-31 14:17:49 -070022 "v.io/v23/services/syncbase/nosql"
Himabindu Puchafb26a832015-05-20 15:37:50 -070023)
24
Raja Daoud52851362015-09-14 15:50:40 -070025var (
26 ErrDupSyncGroupPublish = verror.Register("v.io/x/ref/services/syncbase/server/interfaces.DupSyncGroupPublish", verror.NoRetry, "{1:}{2:} duplicate publish on SyncGroup: {3}")
27)
28
29func init() {
30 i18n.Cat().SetWithBase(i18n.LangID("en"), i18n.MsgID(ErrDupSyncGroupPublish.ID), "{1:}{2:} duplicate publish on SyncGroup: {3}")
31}
32
33// NewErrDupSyncGroupPublish returns an error with the ErrDupSyncGroupPublish ID.
34func NewErrDupSyncGroupPublish(ctx *context.T, name string) error {
35 return verror.New(ErrDupSyncGroupPublish, ctx, name)
36}
37
Himabindu Puchafb26a832015-05-20 15:37:50 -070038// SyncClientMethods is the client interface
39// containing Sync methods.
40//
41// Sync defines methods for data exchange between Syncbases.
42// TODO(hpucha): Flesh this out further.
43type SyncClientMethods interface {
Himabindu Pucha03ef3932015-06-26 17:56:09 -070044 // GetDeltas returns the responder's current generation vector and all
45 // the missing log records when compared to the initiator's generation
Himabindu Puchab41fc142015-09-10 17:10:57 -070046 // vector for one Database for either SyncGroup metadata or data.
47 GetDeltas(ctx *context.T, req DeltaReq, initiator string, opts ...rpc.CallOpt) (SyncGetDeltasClientCall, error)
Raja Daoud52851362015-09-14 15:50:40 -070048 // PublishSyncGroup is invoked on the SyncGroup name (typically served
49 // by a "central" peer) to publish the SyncGroup. It takes the name of
50 // Syncbase doing the publishing (the publisher) and returns the name
51 // of the Syncbase where the SyncGroup is published (the publishee).
52 // This allows the publisher and the publishee to learn of each other.
53 // When a SyncGroup is published, the publishee is given the SyncGroup
54 // metadata, its current version at the publisher, and the current
55 // SyncGroup generation vector. The generation vector serves as a
56 // checkpoint at the time of publishing. The publishing proceeds
57 // asynchronously, and the publishee learns the SyncGroup history
58 // through the routine p2p sync process and determines when it has
59 // caught up to the level of knowledge at the time of publishing using
60 // the checkpointed generation vector. Until that point, the publishee
61 // locally deems the SyncGroup to be in a pending state and does not
62 // mutate it. Thus it locally rejects SyncGroup joins or updates to
63 // its spec until it is caught up on the SyncGroup history.
64 PublishSyncGroup(ctx *context.T, publisher string, sg SyncGroup, version string, genvec PrefixGenVector, opts ...rpc.CallOpt) (string, error)
Himabindu Pucha12e1a122015-06-08 15:59:09 -070065 // JoinSyncGroupAtAdmin is invoked by a prospective SyncGroup member's
66 // Syncbase on a SyncGroup admin. It checks whether the requestor is
67 // allowed to join the named SyncGroup, and if so, adds the requestor to
Raja Daoud52851362015-09-14 15:50:40 -070068 // the SyncGroup. It returns a copy of the updated SyncGroup metadata,
69 // its version, and the SyncGroup generation vector at the time of the
70 // join. Similar to the PublishSyncGroup scenario, the joiner at that
71 // point does not have the SyncGroup history and locally deems it to be
72 // in a pending state and does not mutate it. This means it rejects
73 // local updates to the SyncGroup spec or, if it were also an admin on
74 // the SyncGroup, it would reject SyncGroup joins until it is caught up
75 // on the SyncGroup history through p2p sync.
76 JoinSyncGroupAtAdmin(ctx *context.T, sgName string, joinerName string, myInfo nosql.SyncGroupMemberInfo, opts ...rpc.CallOpt) (sg SyncGroup, version string, genvec PrefixGenVector, err error)
Himabindu Pucha665f14c2015-08-13 13:42:01 -070077 // HaveBlob verifies that the peer has the requested blob, and if
78 // present, returns its size.
79 HaveBlob(ctx *context.T, br nosql.BlobRef, opts ...rpc.CallOpt) (int64, error)
80 // FetchBlob fetches the requested blob.
81 FetchBlob(ctx *context.T, br nosql.BlobRef, opts ...rpc.CallOpt) (SyncFetchBlobClientCall, error)
82 // Methods for incremental blob transfer. The transfer starts with the
83 // receiver making a FetchBlobRecipe call to the sender for a given
84 // BlobRef. The sender, in turn, sends the chunk hashes of all the
85 // chunks that make up the requested blob (blob recipe). The receiver
86 // looks up the chunk hashes in its local blob store, and identifies the
87 // missing ones. The receiver then fetches the missing chunks using a
88 // FetchChunks call from the sender. Finally, the receiver finishes the
89 // blob fetch by combining the chunks obtained over the network with the
90 // already available local chunks as per the blob recipe.
91 FetchBlobRecipe(ctx *context.T, br nosql.BlobRef, opts ...rpc.CallOpt) (SyncFetchBlobRecipeClientCall, error)
92 FetchChunks(*context.T, ...rpc.CallOpt) (SyncFetchChunksClientCall, error)
Himabindu Puchafb26a832015-05-20 15:37:50 -070093}
94
95// SyncClientStub adds universal methods to SyncClientMethods.
96type SyncClientStub interface {
97 SyncClientMethods
98 rpc.UniversalServiceMethods
99}
100
101// SyncClient returns a client stub for Sync.
102func SyncClient(name string) SyncClientStub {
103 return implSyncClientStub{name}
104}
105
106type implSyncClientStub struct {
107 name string
108}
109
Himabindu Puchab41fc142015-09-10 17:10:57 -0700110func (c implSyncClientStub) GetDeltas(ctx *context.T, i0 DeltaReq, i1 string, opts ...rpc.CallOpt) (ocall SyncGetDeltasClientCall, err error) {
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700111 var call rpc.ClientCall
Himabindu Puchab41fc142015-09-10 17:10:57 -0700112 if call, err = v23.GetClient(ctx).StartCall(ctx, c.name, "GetDeltas", []interface{}{i0, i1}, opts...); err != nil {
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700113 return
114 }
115 ocall = &implSyncGetDeltasClientCall{ClientCall: call}
Himabindu Puchafb26a832015-05-20 15:37:50 -0700116 return
117}
118
Raja Daoud52851362015-09-14 15:50:40 -0700119func (c implSyncClientStub) PublishSyncGroup(ctx *context.T, i0 string, i1 SyncGroup, i2 string, i3 PrefixGenVector, opts ...rpc.CallOpt) (o0 string, err error) {
120 err = v23.GetClient(ctx).Call(ctx, c.name, "PublishSyncGroup", []interface{}{i0, i1, i2, i3}, []interface{}{&o0}, opts...)
Himabindu Puchafb26a832015-05-20 15:37:50 -0700121 return
122}
123
Raja Daoud52851362015-09-14 15:50:40 -0700124func (c implSyncClientStub) JoinSyncGroupAtAdmin(ctx *context.T, i0 string, i1 string, i2 nosql.SyncGroupMemberInfo, opts ...rpc.CallOpt) (o0 SyncGroup, o1 string, o2 PrefixGenVector, err error) {
125 err = v23.GetClient(ctx).Call(ctx, c.name, "JoinSyncGroupAtAdmin", []interface{}{i0, i1, i2}, []interface{}{&o0, &o1, &o2}, opts...)
Himabindu Puchafb26a832015-05-20 15:37:50 -0700126 return
127}
128
Himabindu Pucha665f14c2015-08-13 13:42:01 -0700129func (c implSyncClientStub) HaveBlob(ctx *context.T, i0 nosql.BlobRef, opts ...rpc.CallOpt) (o0 int64, err error) {
130 err = v23.GetClient(ctx).Call(ctx, c.name, "HaveBlob", []interface{}{i0}, []interface{}{&o0}, opts...)
131 return
132}
133
134func (c implSyncClientStub) FetchBlob(ctx *context.T, i0 nosql.BlobRef, opts ...rpc.CallOpt) (ocall SyncFetchBlobClientCall, err error) {
135 var call rpc.ClientCall
136 if call, err = v23.GetClient(ctx).StartCall(ctx, c.name, "FetchBlob", []interface{}{i0}, opts...); err != nil {
137 return
138 }
139 ocall = &implSyncFetchBlobClientCall{ClientCall: call}
140 return
141}
142
143func (c implSyncClientStub) FetchBlobRecipe(ctx *context.T, i0 nosql.BlobRef, opts ...rpc.CallOpt) (ocall SyncFetchBlobRecipeClientCall, err error) {
144 var call rpc.ClientCall
145 if call, err = v23.GetClient(ctx).StartCall(ctx, c.name, "FetchBlobRecipe", []interface{}{i0}, opts...); err != nil {
146 return
147 }
148 ocall = &implSyncFetchBlobRecipeClientCall{ClientCall: call}
149 return
150}
151
152func (c implSyncClientStub) FetchChunks(ctx *context.T, opts ...rpc.CallOpt) (ocall SyncFetchChunksClientCall, err error) {
153 var call rpc.ClientCall
154 if call, err = v23.GetClient(ctx).StartCall(ctx, c.name, "FetchChunks", nil, opts...); err != nil {
155 return
156 }
157 ocall = &implSyncFetchChunksClientCall{ClientCall: call}
Himabindu Puchafb26a832015-05-20 15:37:50 -0700158 return
159}
160
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700161// SyncGetDeltasClientStream is the client stream for Sync.GetDeltas.
162type SyncGetDeltasClientStream interface {
163 // RecvStream returns the receiver side of the Sync.GetDeltas client stream.
164 RecvStream() interface {
165 // Advance stages an item so that it may be retrieved via Value. Returns
166 // true iff there is an item to retrieve. Advance must be called before
167 // Value is called. May block if an item is not available.
168 Advance() bool
169 // Value returns the item that was staged by Advance. May panic if Advance
170 // returned false or was not called. Never blocks.
171 Value() DeltaResp
172 // Err returns any error encountered by Advance. Never blocks.
173 Err() error
174 }
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700175}
176
177// SyncGetDeltasClientCall represents the call returned from Sync.GetDeltas.
178type SyncGetDeltasClientCall interface {
179 SyncGetDeltasClientStream
Himabindu Puchab41fc142015-09-10 17:10:57 -0700180 // Finish blocks until the server is done, and returns the positional return
181 // values for call.
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700182 //
183 // Finish returns immediately if the call has been canceled; depending on the
184 // timing the output could either be an error signaling cancelation, or the
185 // valid positional return values from the server.
186 //
187 // Calling Finish is mandatory for releasing stream resources, unless the call
188 // has been canceled or any of the other methods return an error. Finish should
189 // be called at most once.
190 Finish() error
191}
192
193type implSyncGetDeltasClientCall struct {
194 rpc.ClientCall
195 valRecv DeltaResp
196 errRecv error
197}
198
199func (c *implSyncGetDeltasClientCall) RecvStream() interface {
200 Advance() bool
201 Value() DeltaResp
202 Err() error
203} {
204 return implSyncGetDeltasClientCallRecv{c}
205}
206
207type implSyncGetDeltasClientCallRecv struct {
208 c *implSyncGetDeltasClientCall
209}
210
211func (c implSyncGetDeltasClientCallRecv) Advance() bool {
212 c.c.errRecv = c.c.Recv(&c.c.valRecv)
213 return c.c.errRecv == nil
214}
215func (c implSyncGetDeltasClientCallRecv) Value() DeltaResp {
216 return c.c.valRecv
217}
218func (c implSyncGetDeltasClientCallRecv) Err() error {
219 if c.c.errRecv == io.EOF {
220 return nil
221 }
222 return c.c.errRecv
223}
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700224func (c *implSyncGetDeltasClientCall) Finish() (err error) {
225 err = c.ClientCall.Finish()
226 return
227}
228
Himabindu Pucha665f14c2015-08-13 13:42:01 -0700229// SyncFetchBlobClientStream is the client stream for Sync.FetchBlob.
230type SyncFetchBlobClientStream interface {
231 // RecvStream returns the receiver side of the Sync.FetchBlob client stream.
232 RecvStream() interface {
233 // Advance stages an item so that it may be retrieved via Value. Returns
234 // true iff there is an item to retrieve. Advance must be called before
235 // Value is called. May block if an item is not available.
236 Advance() bool
237 // Value returns the item that was staged by Advance. May panic if Advance
238 // returned false or was not called. Never blocks.
239 Value() []byte
240 // Err returns any error encountered by Advance. Never blocks.
241 Err() error
242 }
243}
244
245// SyncFetchBlobClientCall represents the call returned from Sync.FetchBlob.
246type SyncFetchBlobClientCall interface {
247 SyncFetchBlobClientStream
248 // Finish blocks until the server is done, and returns the positional return
249 // values for call.
250 //
251 // Finish returns immediately if the call has been canceled; depending on the
252 // timing the output could either be an error signaling cancelation, or the
253 // valid positional return values from the server.
254 //
255 // Calling Finish is mandatory for releasing stream resources, unless the call
256 // has been canceled or any of the other methods return an error. Finish should
257 // be called at most once.
258 Finish() error
259}
260
261type implSyncFetchBlobClientCall struct {
262 rpc.ClientCall
263 valRecv []byte
264 errRecv error
265}
266
267func (c *implSyncFetchBlobClientCall) RecvStream() interface {
268 Advance() bool
269 Value() []byte
270 Err() error
271} {
272 return implSyncFetchBlobClientCallRecv{c}
273}
274
275type implSyncFetchBlobClientCallRecv struct {
276 c *implSyncFetchBlobClientCall
277}
278
279func (c implSyncFetchBlobClientCallRecv) Advance() bool {
280 c.c.errRecv = c.c.Recv(&c.c.valRecv)
281 return c.c.errRecv == nil
282}
283func (c implSyncFetchBlobClientCallRecv) Value() []byte {
284 return c.c.valRecv
285}
286func (c implSyncFetchBlobClientCallRecv) Err() error {
287 if c.c.errRecv == io.EOF {
288 return nil
289 }
290 return c.c.errRecv
291}
292func (c *implSyncFetchBlobClientCall) Finish() (err error) {
293 err = c.ClientCall.Finish()
294 return
295}
296
297// SyncFetchBlobRecipeClientStream is the client stream for Sync.FetchBlobRecipe.
298type SyncFetchBlobRecipeClientStream interface {
299 // RecvStream returns the receiver side of the Sync.FetchBlobRecipe client stream.
300 RecvStream() interface {
301 // Advance stages an item so that it may be retrieved via Value. Returns
302 // true iff there is an item to retrieve. Advance must be called before
303 // Value is called. May block if an item is not available.
304 Advance() bool
305 // Value returns the item that was staged by Advance. May panic if Advance
306 // returned false or was not called. Never blocks.
307 Value() ChunkHash
308 // Err returns any error encountered by Advance. Never blocks.
309 Err() error
310 }
311}
312
313// SyncFetchBlobRecipeClientCall represents the call returned from Sync.FetchBlobRecipe.
314type SyncFetchBlobRecipeClientCall interface {
315 SyncFetchBlobRecipeClientStream
316 // Finish blocks until the server is done, and returns the positional return
317 // values for call.
318 //
319 // Finish returns immediately if the call has been canceled; depending on the
320 // timing the output could either be an error signaling cancelation, or the
321 // valid positional return values from the server.
322 //
323 // Calling Finish is mandatory for releasing stream resources, unless the call
324 // has been canceled or any of the other methods return an error. Finish should
325 // be called at most once.
326 Finish() error
327}
328
329type implSyncFetchBlobRecipeClientCall struct {
330 rpc.ClientCall
331 valRecv ChunkHash
332 errRecv error
333}
334
335func (c *implSyncFetchBlobRecipeClientCall) RecvStream() interface {
336 Advance() bool
337 Value() ChunkHash
338 Err() error
339} {
340 return implSyncFetchBlobRecipeClientCallRecv{c}
341}
342
343type implSyncFetchBlobRecipeClientCallRecv struct {
344 c *implSyncFetchBlobRecipeClientCall
345}
346
347func (c implSyncFetchBlobRecipeClientCallRecv) Advance() bool {
348 c.c.valRecv = ChunkHash{}
349 c.c.errRecv = c.c.Recv(&c.c.valRecv)
350 return c.c.errRecv == nil
351}
352func (c implSyncFetchBlobRecipeClientCallRecv) Value() ChunkHash {
353 return c.c.valRecv
354}
355func (c implSyncFetchBlobRecipeClientCallRecv) Err() error {
356 if c.c.errRecv == io.EOF {
357 return nil
358 }
359 return c.c.errRecv
360}
361func (c *implSyncFetchBlobRecipeClientCall) Finish() (err error) {
362 err = c.ClientCall.Finish()
363 return
364}
365
366// SyncFetchChunksClientStream is the client stream for Sync.FetchChunks.
367type SyncFetchChunksClientStream interface {
368 // RecvStream returns the receiver side of the Sync.FetchChunks client stream.
369 RecvStream() interface {
370 // Advance stages an item so that it may be retrieved via Value. Returns
371 // true iff there is an item to retrieve. Advance must be called before
372 // Value is called. May block if an item is not available.
373 Advance() bool
374 // Value returns the item that was staged by Advance. May panic if Advance
375 // returned false or was not called. Never blocks.
376 Value() ChunkData
377 // Err returns any error encountered by Advance. Never blocks.
378 Err() error
379 }
380 // SendStream returns the send side of the Sync.FetchChunks client stream.
381 SendStream() interface {
382 // Send places the item onto the output stream. Returns errors
383 // encountered while sending, or if Send is called after Close or
384 // the stream has been canceled. Blocks if there is no buffer
385 // space; will unblock when buffer space is available or after
386 // the stream has been canceled.
387 Send(item ChunkHash) error
388 // Close indicates to the server that no more items will be sent;
389 // server Recv calls will receive io.EOF after all sent items.
390 // This is an optional call - e.g. a client might call Close if it
391 // needs to continue receiving items from the server after it's
392 // done sending. Returns errors encountered while closing, or if
393 // Close is called after the stream has been canceled. Like Send,
394 // blocks if there is no buffer space available.
395 Close() error
396 }
397}
398
399// SyncFetchChunksClientCall represents the call returned from Sync.FetchChunks.
400type SyncFetchChunksClientCall interface {
401 SyncFetchChunksClientStream
402 // Finish performs the equivalent of SendStream().Close, then blocks until
403 // the server is done, and returns the positional return values for the call.
404 //
405 // Finish returns immediately if the call has been canceled; depending on the
406 // timing the output could either be an error signaling cancelation, or the
407 // valid positional return values from the server.
408 //
409 // Calling Finish is mandatory for releasing stream resources, unless the call
410 // has been canceled or any of the other methods return an error. Finish should
411 // be called at most once.
412 Finish() error
413}
414
415type implSyncFetchChunksClientCall struct {
416 rpc.ClientCall
417 valRecv ChunkData
418 errRecv error
419}
420
421func (c *implSyncFetchChunksClientCall) RecvStream() interface {
422 Advance() bool
423 Value() ChunkData
424 Err() error
425} {
426 return implSyncFetchChunksClientCallRecv{c}
427}
428
429type implSyncFetchChunksClientCallRecv struct {
430 c *implSyncFetchChunksClientCall
431}
432
433func (c implSyncFetchChunksClientCallRecv) Advance() bool {
434 c.c.valRecv = ChunkData{}
435 c.c.errRecv = c.c.Recv(&c.c.valRecv)
436 return c.c.errRecv == nil
437}
438func (c implSyncFetchChunksClientCallRecv) Value() ChunkData {
439 return c.c.valRecv
440}
441func (c implSyncFetchChunksClientCallRecv) Err() error {
442 if c.c.errRecv == io.EOF {
443 return nil
444 }
445 return c.c.errRecv
446}
447func (c *implSyncFetchChunksClientCall) SendStream() interface {
448 Send(item ChunkHash) error
449 Close() error
450} {
451 return implSyncFetchChunksClientCallSend{c}
452}
453
454type implSyncFetchChunksClientCallSend struct {
455 c *implSyncFetchChunksClientCall
456}
457
458func (c implSyncFetchChunksClientCallSend) Send(item ChunkHash) error {
459 return c.c.Send(item)
460}
461func (c implSyncFetchChunksClientCallSend) Close() error {
462 return c.c.CloseSend()
463}
464func (c *implSyncFetchChunksClientCall) Finish() (err error) {
465 err = c.ClientCall.Finish()
466 return
467}
468
Himabindu Puchafb26a832015-05-20 15:37:50 -0700469// SyncServerMethods is the interface a server writer
470// implements for Sync.
471//
472// Sync defines methods for data exchange between Syncbases.
473// TODO(hpucha): Flesh this out further.
474type SyncServerMethods interface {
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700475 // GetDeltas returns the responder's current generation vector and all
476 // the missing log records when compared to the initiator's generation
Himabindu Puchab41fc142015-09-10 17:10:57 -0700477 // vector for one Database for either SyncGroup metadata or data.
478 GetDeltas(ctx *context.T, call SyncGetDeltasServerCall, req DeltaReq, initiator string) error
Raja Daoud52851362015-09-14 15:50:40 -0700479 // PublishSyncGroup is invoked on the SyncGroup name (typically served
480 // by a "central" peer) to publish the SyncGroup. It takes the name of
481 // Syncbase doing the publishing (the publisher) and returns the name
482 // of the Syncbase where the SyncGroup is published (the publishee).
483 // This allows the publisher and the publishee to learn of each other.
484 // When a SyncGroup is published, the publishee is given the SyncGroup
485 // metadata, its current version at the publisher, and the current
486 // SyncGroup generation vector. The generation vector serves as a
487 // checkpoint at the time of publishing. The publishing proceeds
488 // asynchronously, and the publishee learns the SyncGroup history
489 // through the routine p2p sync process and determines when it has
490 // caught up to the level of knowledge at the time of publishing using
491 // the checkpointed generation vector. Until that point, the publishee
492 // locally deems the SyncGroup to be in a pending state and does not
493 // mutate it. Thus it locally rejects SyncGroup joins or updates to
494 // its spec until it is caught up on the SyncGroup history.
495 PublishSyncGroup(ctx *context.T, call rpc.ServerCall, publisher string, sg SyncGroup, version string, genvec PrefixGenVector) (string, error)
Himabindu Pucha12e1a122015-06-08 15:59:09 -0700496 // JoinSyncGroupAtAdmin is invoked by a prospective SyncGroup member's
497 // Syncbase on a SyncGroup admin. It checks whether the requestor is
498 // allowed to join the named SyncGroup, and if so, adds the requestor to
Raja Daoud52851362015-09-14 15:50:40 -0700499 // the SyncGroup. It returns a copy of the updated SyncGroup metadata,
500 // its version, and the SyncGroup generation vector at the time of the
501 // join. Similar to the PublishSyncGroup scenario, the joiner at that
502 // point does not have the SyncGroup history and locally deems it to be
503 // in a pending state and does not mutate it. This means it rejects
504 // local updates to the SyncGroup spec or, if it were also an admin on
505 // the SyncGroup, it would reject SyncGroup joins until it is caught up
506 // on the SyncGroup history through p2p sync.
507 JoinSyncGroupAtAdmin(ctx *context.T, call rpc.ServerCall, sgName string, joinerName string, myInfo nosql.SyncGroupMemberInfo) (sg SyncGroup, version string, genvec PrefixGenVector, err error)
Himabindu Pucha665f14c2015-08-13 13:42:01 -0700508 // HaveBlob verifies that the peer has the requested blob, and if
509 // present, returns its size.
510 HaveBlob(ctx *context.T, call rpc.ServerCall, br nosql.BlobRef) (int64, error)
511 // FetchBlob fetches the requested blob.
512 FetchBlob(ctx *context.T, call SyncFetchBlobServerCall, br nosql.BlobRef) error
513 // Methods for incremental blob transfer. The transfer starts with the
514 // receiver making a FetchBlobRecipe call to the sender for a given
515 // BlobRef. The sender, in turn, sends the chunk hashes of all the
516 // chunks that make up the requested blob (blob recipe). The receiver
517 // looks up the chunk hashes in its local blob store, and identifies the
518 // missing ones. The receiver then fetches the missing chunks using a
519 // FetchChunks call from the sender. Finally, the receiver finishes the
520 // blob fetch by combining the chunks obtained over the network with the
521 // already available local chunks as per the blob recipe.
522 FetchBlobRecipe(ctx *context.T, call SyncFetchBlobRecipeServerCall, br nosql.BlobRef) error
523 FetchChunks(*context.T, SyncFetchChunksServerCall) error
Himabindu Puchafb26a832015-05-20 15:37:50 -0700524}
525
526// SyncServerStubMethods is the server interface containing
527// Sync methods, as expected by rpc.Server.
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700528// The only difference between this interface and SyncServerMethods
529// is the streaming methods.
530type SyncServerStubMethods interface {
531 // GetDeltas returns the responder's current generation vector and all
532 // the missing log records when compared to the initiator's generation
Himabindu Puchab41fc142015-09-10 17:10:57 -0700533 // vector for one Database for either SyncGroup metadata or data.
534 GetDeltas(ctx *context.T, call *SyncGetDeltasServerCallStub, req DeltaReq, initiator string) error
Raja Daoud52851362015-09-14 15:50:40 -0700535 // PublishSyncGroup is invoked on the SyncGroup name (typically served
536 // by a "central" peer) to publish the SyncGroup. It takes the name of
537 // Syncbase doing the publishing (the publisher) and returns the name
538 // of the Syncbase where the SyncGroup is published (the publishee).
539 // This allows the publisher and the publishee to learn of each other.
540 // When a SyncGroup is published, the publishee is given the SyncGroup
541 // metadata, its current version at the publisher, and the current
542 // SyncGroup generation vector. The generation vector serves as a
543 // checkpoint at the time of publishing. The publishing proceeds
544 // asynchronously, and the publishee learns the SyncGroup history
545 // through the routine p2p sync process and determines when it has
546 // caught up to the level of knowledge at the time of publishing using
547 // the checkpointed generation vector. Until that point, the publishee
548 // locally deems the SyncGroup to be in a pending state and does not
549 // mutate it. Thus it locally rejects SyncGroup joins or updates to
550 // its spec until it is caught up on the SyncGroup history.
551 PublishSyncGroup(ctx *context.T, call rpc.ServerCall, publisher string, sg SyncGroup, version string, genvec PrefixGenVector) (string, error)
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700552 // JoinSyncGroupAtAdmin is invoked by a prospective SyncGroup member's
553 // Syncbase on a SyncGroup admin. It checks whether the requestor is
554 // allowed to join the named SyncGroup, and if so, adds the requestor to
Raja Daoud52851362015-09-14 15:50:40 -0700555 // the SyncGroup. It returns a copy of the updated SyncGroup metadata,
556 // its version, and the SyncGroup generation vector at the time of the
557 // join. Similar to the PublishSyncGroup scenario, the joiner at that
558 // point does not have the SyncGroup history and locally deems it to be
559 // in a pending state and does not mutate it. This means it rejects
560 // local updates to the SyncGroup spec or, if it were also an admin on
561 // the SyncGroup, it would reject SyncGroup joins until it is caught up
562 // on the SyncGroup history through p2p sync.
563 JoinSyncGroupAtAdmin(ctx *context.T, call rpc.ServerCall, sgName string, joinerName string, myInfo nosql.SyncGroupMemberInfo) (sg SyncGroup, version string, genvec PrefixGenVector, err error)
Himabindu Pucha665f14c2015-08-13 13:42:01 -0700564 // HaveBlob verifies that the peer has the requested blob, and if
565 // present, returns its size.
566 HaveBlob(ctx *context.T, call rpc.ServerCall, br nosql.BlobRef) (int64, error)
567 // FetchBlob fetches the requested blob.
568 FetchBlob(ctx *context.T, call *SyncFetchBlobServerCallStub, br nosql.BlobRef) error
569 // Methods for incremental blob transfer. The transfer starts with the
570 // receiver making a FetchBlobRecipe call to the sender for a given
571 // BlobRef. The sender, in turn, sends the chunk hashes of all the
572 // chunks that make up the requested blob (blob recipe). The receiver
573 // looks up the chunk hashes in its local blob store, and identifies the
574 // missing ones. The receiver then fetches the missing chunks using a
575 // FetchChunks call from the sender. Finally, the receiver finishes the
576 // blob fetch by combining the chunks obtained over the network with the
577 // already available local chunks as per the blob recipe.
578 FetchBlobRecipe(ctx *context.T, call *SyncFetchBlobRecipeServerCallStub, br nosql.BlobRef) error
579 FetchChunks(*context.T, *SyncFetchChunksServerCallStub) error
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700580}
Himabindu Puchafb26a832015-05-20 15:37:50 -0700581
582// SyncServerStub adds universal methods to SyncServerStubMethods.
583type SyncServerStub interface {
584 SyncServerStubMethods
585 // Describe the Sync interfaces.
586 Describe__() []rpc.InterfaceDesc
587}
588
589// SyncServer returns a server stub for Sync.
590// It converts an implementation of SyncServerMethods into
591// an object that may be used by rpc.Server.
592func SyncServer(impl SyncServerMethods) SyncServerStub {
593 stub := implSyncServerStub{
594 impl: impl,
595 }
596 // Initialize GlobState; always check the stub itself first, to handle the
597 // case where the user has the Glob method defined in their VDL source.
598 if gs := rpc.NewGlobState(stub); gs != nil {
599 stub.gs = gs
600 } else if gs := rpc.NewGlobState(impl); gs != nil {
601 stub.gs = gs
602 }
603 return stub
604}
605
606type implSyncServerStub struct {
607 impl SyncServerMethods
608 gs *rpc.GlobState
609}
610
Himabindu Puchab41fc142015-09-10 17:10:57 -0700611func (s implSyncServerStub) GetDeltas(ctx *context.T, call *SyncGetDeltasServerCallStub, i0 DeltaReq, i1 string) error {
612 return s.impl.GetDeltas(ctx, call, i0, i1)
Himabindu Puchafb26a832015-05-20 15:37:50 -0700613}
614
Raja Daoud52851362015-09-14 15:50:40 -0700615func (s implSyncServerStub) PublishSyncGroup(ctx *context.T, call rpc.ServerCall, i0 string, i1 SyncGroup, i2 string, i3 PrefixGenVector) (string, error) {
616 return s.impl.PublishSyncGroup(ctx, call, i0, i1, i2, i3)
Himabindu Puchafb26a832015-05-20 15:37:50 -0700617}
618
Raja Daoud52851362015-09-14 15:50:40 -0700619func (s implSyncServerStub) JoinSyncGroupAtAdmin(ctx *context.T, call rpc.ServerCall, i0 string, i1 string, i2 nosql.SyncGroupMemberInfo) (SyncGroup, string, PrefixGenVector, error) {
Himabindu Pucha12e1a122015-06-08 15:59:09 -0700620 return s.impl.JoinSyncGroupAtAdmin(ctx, call, i0, i1, i2)
Himabindu Puchafb26a832015-05-20 15:37:50 -0700621}
622
Himabindu Pucha665f14c2015-08-13 13:42:01 -0700623func (s implSyncServerStub) HaveBlob(ctx *context.T, call rpc.ServerCall, i0 nosql.BlobRef) (int64, error) {
624 return s.impl.HaveBlob(ctx, call, i0)
625}
626
627func (s implSyncServerStub) FetchBlob(ctx *context.T, call *SyncFetchBlobServerCallStub, i0 nosql.BlobRef) error {
Himabindu Pucha785502f2015-07-17 13:34:02 -0700628 return s.impl.FetchBlob(ctx, call, i0)
Himabindu Puchafb26a832015-05-20 15:37:50 -0700629}
630
Himabindu Pucha665f14c2015-08-13 13:42:01 -0700631func (s implSyncServerStub) FetchBlobRecipe(ctx *context.T, call *SyncFetchBlobRecipeServerCallStub, i0 nosql.BlobRef) error {
632 return s.impl.FetchBlobRecipe(ctx, call, i0)
633}
634
635func (s implSyncServerStub) FetchChunks(ctx *context.T, call *SyncFetchChunksServerCallStub) error {
636 return s.impl.FetchChunks(ctx, call)
637}
638
Himabindu Puchafb26a832015-05-20 15:37:50 -0700639func (s implSyncServerStub) Globber() *rpc.GlobState {
640 return s.gs
641}
642
643func (s implSyncServerStub) Describe__() []rpc.InterfaceDesc {
644 return []rpc.InterfaceDesc{SyncDesc}
645}
646
647// SyncDesc describes the Sync interface.
648var SyncDesc rpc.InterfaceDesc = descSync
649
650// descSync hides the desc to keep godoc clean.
651var descSync = rpc.InterfaceDesc{
652 Name: "Sync",
Adam Sadovskyc9082332015-08-31 13:58:38 -0700653 PkgPath: "v.io/x/ref/services/syncbase/server/interfaces",
Himabindu Puchafb26a832015-05-20 15:37:50 -0700654 Doc: "// Sync defines methods for data exchange between Syncbases.\n// TODO(hpucha): Flesh this out further.",
655 Methods: []rpc.MethodDesc{
656 {
657 Name: "GetDeltas",
Himabindu Puchab41fc142015-09-10 17:10:57 -0700658 Doc: "// GetDeltas returns the responder's current generation vector and all\n// the missing log records when compared to the initiator's generation\n// vector for one Database for either SyncGroup metadata or data.",
Raja Daoudccfd6c12015-08-03 18:46:28 -0700659 InArgs: []rpc.ArgDesc{
Himabindu Puchab41fc142015-09-10 17:10:57 -0700660 {"req", ``}, // DeltaReq
Raja Daoudccfd6c12015-08-03 18:46:28 -0700661 {"initiator", ``}, // string
662 },
Sergey Rogulenkoc2e60f62015-06-23 14:50:58 -0700663 Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Read"))},
Himabindu Puchafb26a832015-05-20 15:37:50 -0700664 },
665 {
Himabindu Puchaf9ec56f2015-06-02 11:34:05 -0700666 Name: "PublishSyncGroup",
Raja Daoud52851362015-09-14 15:50:40 -0700667 Doc: "// PublishSyncGroup is invoked on the SyncGroup name (typically served\n// by a \"central\" peer) to publish the SyncGroup. It takes the name of\n// Syncbase doing the publishing (the publisher) and returns the name\n// of the Syncbase where the SyncGroup is published (the publishee).\n// This allows the publisher and the publishee to learn of each other.\n// When a SyncGroup is published, the publishee is given the SyncGroup\n// metadata, its current version at the publisher, and the current\n// SyncGroup generation vector. The generation vector serves as a\n// checkpoint at the time of publishing. The publishing proceeds\n// asynchronously, and the publishee learns the SyncGroup history\n// through the routine p2p sync process and determines when it has\n// caught up to the level of knowledge at the time of publishing using\n// the checkpointed generation vector. Until that point, the publishee\n// locally deems the SyncGroup to be in a pending state and does not\n// mutate it. Thus it locally rejects SyncGroup joins or updates to\n// its spec until it is caught up on the SyncGroup history.",
Himabindu Puchaf9ec56f2015-06-02 11:34:05 -0700668 InArgs: []rpc.ArgDesc{
Raja Daoud52851362015-09-14 15:50:40 -0700669 {"publisher", ``}, // string
670 {"sg", ``}, // SyncGroup
671 {"version", ``}, // string
672 {"genvec", ``}, // PrefixGenVector
673 },
674 OutArgs: []rpc.ArgDesc{
675 {"", ``}, // string
Himabindu Puchaf9ec56f2015-06-02 11:34:05 -0700676 },
Sergey Rogulenkoc2e60f62015-06-23 14:50:58 -0700677 Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Write"))},
Himabindu Puchafb26a832015-05-20 15:37:50 -0700678 },
679 {
Himabindu Pucha12e1a122015-06-08 15:59:09 -0700680 Name: "JoinSyncGroupAtAdmin",
Raja Daoud52851362015-09-14 15:50:40 -0700681 Doc: "// JoinSyncGroupAtAdmin is invoked by a prospective SyncGroup member's\n// Syncbase on a SyncGroup admin. It checks whether the requestor is\n// allowed to join the named SyncGroup, and if so, adds the requestor to\n// the SyncGroup. It returns a copy of the updated SyncGroup metadata,\n// its version, and the SyncGroup generation vector at the time of the\n// join. Similar to the PublishSyncGroup scenario, the joiner at that\n// point does not have the SyncGroup history and locally deems it to be\n// in a pending state and does not mutate it. This means it rejects\n// local updates to the SyncGroup spec or, if it were also an admin on\n// the SyncGroup, it would reject SyncGroup joins until it is caught up\n// on the SyncGroup history through p2p sync.",
Himabindu Pucha12e1a122015-06-08 15:59:09 -0700682 InArgs: []rpc.ArgDesc{
683 {"sgName", ``}, // string
684 {"joinerName", ``}, // string
685 {"myInfo", ``}, // nosql.SyncGroupMemberInfo
686 },
687 OutArgs: []rpc.ArgDesc{
Raja Daoud52851362015-09-14 15:50:40 -0700688 {"sg", ``}, // SyncGroup
689 {"version", ``}, // string
690 {"genvec", ``}, // PrefixGenVector
Himabindu Pucha12e1a122015-06-08 15:59:09 -0700691 },
Sergey Rogulenkoc2e60f62015-06-23 14:50:58 -0700692 Tags: []*vdl.Value{vdl.ValueOf(access.Tag("Read"))},
Himabindu Puchafb26a832015-05-20 15:37:50 -0700693 },
694 {
Himabindu Pucha665f14c2015-08-13 13:42:01 -0700695 Name: "HaveBlob",
696 Doc: "// HaveBlob verifies that the peer has the requested blob, and if\n// present, returns its size.",
Himabindu Pucha785502f2015-07-17 13:34:02 -0700697 InArgs: []rpc.ArgDesc{
698 {"br", ``}, // nosql.BlobRef
699 },
Himabindu Pucha665f14c2015-08-13 13:42:01 -0700700 OutArgs: []rpc.ArgDesc{
701 {"", ``}, // int64
702 },
703 },
704 {
705 Name: "FetchBlob",
706 Doc: "// FetchBlob fetches the requested blob.",
707 InArgs: []rpc.ArgDesc{
708 {"br", ``}, // nosql.BlobRef
709 },
710 },
711 {
712 Name: "FetchBlobRecipe",
713 Doc: "// Methods for incremental blob transfer. The transfer starts with the\n// receiver making a FetchBlobRecipe call to the sender for a given\n// BlobRef. The sender, in turn, sends the chunk hashes of all the\n// chunks that make up the requested blob (blob recipe). The receiver\n// looks up the chunk hashes in its local blob store, and identifies the\n// missing ones. The receiver then fetches the missing chunks using a\n// FetchChunks call from the sender. Finally, the receiver finishes the\n// blob fetch by combining the chunks obtained over the network with the\n// already available local chunks as per the blob recipe.",
714 InArgs: []rpc.ArgDesc{
715 {"br", ``}, // nosql.BlobRef
716 },
717 },
718 {
719 Name: "FetchChunks",
Himabindu Puchafb26a832015-05-20 15:37:50 -0700720 },
721 },
722}
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700723
724// SyncGetDeltasServerStream is the server stream for Sync.GetDeltas.
725type SyncGetDeltasServerStream interface {
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700726 // SendStream returns the send side of the Sync.GetDeltas server stream.
727 SendStream() interface {
728 // Send places the item onto the output stream. Returns errors encountered
729 // while sending. Blocks if there is no buffer space; will unblock when
730 // buffer space is available.
731 Send(item DeltaResp) error
732 }
733}
734
735// SyncGetDeltasServerCall represents the context passed to Sync.GetDeltas.
736type SyncGetDeltasServerCall interface {
737 rpc.ServerCall
738 SyncGetDeltasServerStream
739}
740
741// SyncGetDeltasServerCallStub is a wrapper that converts rpc.StreamServerCall into
742// a typesafe stub that implements SyncGetDeltasServerCall.
743type SyncGetDeltasServerCallStub struct {
744 rpc.StreamServerCall
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700745}
746
747// Init initializes SyncGetDeltasServerCallStub from rpc.StreamServerCall.
748func (s *SyncGetDeltasServerCallStub) Init(call rpc.StreamServerCall) {
749 s.StreamServerCall = call
750}
751
Himabindu Pucha03ef3932015-06-26 17:56:09 -0700752// SendStream returns the send side of the Sync.GetDeltas server stream.
753func (s *SyncGetDeltasServerCallStub) SendStream() interface {
754 Send(item DeltaResp) error
755} {
756 return implSyncGetDeltasServerCallSend{s}
757}
758
759type implSyncGetDeltasServerCallSend struct {
760 s *SyncGetDeltasServerCallStub
761}
762
763func (s implSyncGetDeltasServerCallSend) Send(item DeltaResp) error {
764 return s.s.Send(item)
765}
Himabindu Pucha665f14c2015-08-13 13:42:01 -0700766
767// SyncFetchBlobServerStream is the server stream for Sync.FetchBlob.
768type SyncFetchBlobServerStream interface {
769 // SendStream returns the send side of the Sync.FetchBlob server stream.
770 SendStream() interface {
771 // Send places the item onto the output stream. Returns errors encountered
772 // while sending. Blocks if there is no buffer space; will unblock when
773 // buffer space is available.
774 Send(item []byte) error
775 }
776}
777
778// SyncFetchBlobServerCall represents the context passed to Sync.FetchBlob.
779type SyncFetchBlobServerCall interface {
780 rpc.ServerCall
781 SyncFetchBlobServerStream
782}
783
784// SyncFetchBlobServerCallStub is a wrapper that converts rpc.StreamServerCall into
785// a typesafe stub that implements SyncFetchBlobServerCall.
786type SyncFetchBlobServerCallStub struct {
787 rpc.StreamServerCall
788}
789
790// Init initializes SyncFetchBlobServerCallStub from rpc.StreamServerCall.
791func (s *SyncFetchBlobServerCallStub) Init(call rpc.StreamServerCall) {
792 s.StreamServerCall = call
793}
794
795// SendStream returns the send side of the Sync.FetchBlob server stream.
796func (s *SyncFetchBlobServerCallStub) SendStream() interface {
797 Send(item []byte) error
798} {
799 return implSyncFetchBlobServerCallSend{s}
800}
801
802type implSyncFetchBlobServerCallSend struct {
803 s *SyncFetchBlobServerCallStub
804}
805
806func (s implSyncFetchBlobServerCallSend) Send(item []byte) error {
807 return s.s.Send(item)
808}
809
810// SyncFetchBlobRecipeServerStream is the server stream for Sync.FetchBlobRecipe.
811type SyncFetchBlobRecipeServerStream interface {
812 // SendStream returns the send side of the Sync.FetchBlobRecipe server stream.
813 SendStream() interface {
814 // Send places the item onto the output stream. Returns errors encountered
815 // while sending. Blocks if there is no buffer space; will unblock when
816 // buffer space is available.
817 Send(item ChunkHash) error
818 }
819}
820
821// SyncFetchBlobRecipeServerCall represents the context passed to Sync.FetchBlobRecipe.
822type SyncFetchBlobRecipeServerCall interface {
823 rpc.ServerCall
824 SyncFetchBlobRecipeServerStream
825}
826
827// SyncFetchBlobRecipeServerCallStub is a wrapper that converts rpc.StreamServerCall into
828// a typesafe stub that implements SyncFetchBlobRecipeServerCall.
829type SyncFetchBlobRecipeServerCallStub struct {
830 rpc.StreamServerCall
831}
832
833// Init initializes SyncFetchBlobRecipeServerCallStub from rpc.StreamServerCall.
834func (s *SyncFetchBlobRecipeServerCallStub) Init(call rpc.StreamServerCall) {
835 s.StreamServerCall = call
836}
837
838// SendStream returns the send side of the Sync.FetchBlobRecipe server stream.
839func (s *SyncFetchBlobRecipeServerCallStub) SendStream() interface {
840 Send(item ChunkHash) error
841} {
842 return implSyncFetchBlobRecipeServerCallSend{s}
843}
844
845type implSyncFetchBlobRecipeServerCallSend struct {
846 s *SyncFetchBlobRecipeServerCallStub
847}
848
849func (s implSyncFetchBlobRecipeServerCallSend) Send(item ChunkHash) error {
850 return s.s.Send(item)
851}
852
853// SyncFetchChunksServerStream is the server stream for Sync.FetchChunks.
854type SyncFetchChunksServerStream interface {
855 // RecvStream returns the receiver side of the Sync.FetchChunks server stream.
856 RecvStream() interface {
857 // Advance stages an item so that it may be retrieved via Value. Returns
858 // true iff there is an item to retrieve. Advance must be called before
859 // Value is called. May block if an item is not available.
860 Advance() bool
861 // Value returns the item that was staged by Advance. May panic if Advance
862 // returned false or was not called. Never blocks.
863 Value() ChunkHash
864 // Err returns any error encountered by Advance. Never blocks.
865 Err() error
866 }
867 // SendStream returns the send side of the Sync.FetchChunks server stream.
868 SendStream() interface {
869 // Send places the item onto the output stream. Returns errors encountered
870 // while sending. Blocks if there is no buffer space; will unblock when
871 // buffer space is available.
872 Send(item ChunkData) error
873 }
874}
875
876// SyncFetchChunksServerCall represents the context passed to Sync.FetchChunks.
877type SyncFetchChunksServerCall interface {
878 rpc.ServerCall
879 SyncFetchChunksServerStream
880}
881
882// SyncFetchChunksServerCallStub is a wrapper that converts rpc.StreamServerCall into
883// a typesafe stub that implements SyncFetchChunksServerCall.
884type SyncFetchChunksServerCallStub struct {
885 rpc.StreamServerCall
886 valRecv ChunkHash
887 errRecv error
888}
889
890// Init initializes SyncFetchChunksServerCallStub from rpc.StreamServerCall.
891func (s *SyncFetchChunksServerCallStub) Init(call rpc.StreamServerCall) {
892 s.StreamServerCall = call
893}
894
895// RecvStream returns the receiver side of the Sync.FetchChunks server stream.
896func (s *SyncFetchChunksServerCallStub) RecvStream() interface {
897 Advance() bool
898 Value() ChunkHash
899 Err() error
900} {
901 return implSyncFetchChunksServerCallRecv{s}
902}
903
904type implSyncFetchChunksServerCallRecv struct {
905 s *SyncFetchChunksServerCallStub
906}
907
908func (s implSyncFetchChunksServerCallRecv) Advance() bool {
909 s.s.valRecv = ChunkHash{}
910 s.s.errRecv = s.s.Recv(&s.s.valRecv)
911 return s.s.errRecv == nil
912}
913func (s implSyncFetchChunksServerCallRecv) Value() ChunkHash {
914 return s.s.valRecv
915}
916func (s implSyncFetchChunksServerCallRecv) Err() error {
917 if s.s.errRecv == io.EOF {
918 return nil
919 }
920 return s.s.errRecv
921}
922
923// SendStream returns the send side of the Sync.FetchChunks server stream.
924func (s *SyncFetchChunksServerCallStub) SendStream() interface {
925 Send(item ChunkData) error
926} {
927 return implSyncFetchChunksServerCallSend{s}
928}
929
930type implSyncFetchChunksServerCallSend struct {
931 s *SyncFetchChunksServerCallStub
932}
933
934func (s implSyncFetchChunksServerCallSend) Send(item ChunkData) error {
935 return s.s.Send(item)
936}