SyncAPI

Top

The Sync API allows clients to collaboratively read and write JSON data to a shared resource.

SyncDocument()

Bidirectional streaming RPC for real-time document synchronization

Request: streaming SyncDocumentRequest
Response: streaming SyncDocumentResponse

GetDocumentJSON()

Simple RPC to fetch current document state as JSON

Request: GetDocumentJSONRequest
Response: GetDocumentJSONResponse

GetDocumentJSONRequest

FieldTypeDescription
database_idstring

document_idstring

GetDocumentJSONResponse

FieldTypeDescription
errorStatus

Details of any error that occurred on the call.

jsonstring

The current JSON snapshot of the document

SyncDocumentRequest

FieldTypeDescription
sync_startSyncDocumentStart

Initial sync configuration, must be sent as first message.

updateSyncDocumentUpdate

Updates to apply to the remote document.

sync_stateSyncState

The sync state of the local document

SyncDocumentResponse

FieldTypeDescription
statusStatus

Details of any error that occurred on the call.

state_vectorbytes

The state vector of the Volt (remote) document. Only present in the initial response.

updateSyncDocumentUpdate

Updates to apply to client (local) document.

sync_stateSyncState

The sync state of the Volt (remote) document

SyncDocumentStart

FieldTypeDescription
database_idstring

The id of the database that contains the document.

document_idstring

The id of the document to sync.

state_vectorbytes

The clients state vector. The Volt will respond with updates that should be applied to the local document.

read_onlybool

Set to true to only receive updates from other clients.

SyncDocumentUpdate

FieldTypeDescription
chunkbytes

completebool

SyncState

NameNumberDescription
SYNC_STATE_UNKNOWN0

SYNC_STATE_SYNCING1

SYNC_STATE_DONE2

SYNC_STATE_UPDATE3

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)