Skip to content

Socket API

Method Name Request Type Response Type Description
TransferData StreamFrame StreamFrame Bi-directional framed socket stream with explicit EOF signalling.

Stream frame with raw bytes and explicit EOF signalling. chunk is always the payload bytes for this frame. EOF is represented by eof = true (typically with empty chunk).

Field Type Label Description
Chunk bytes Raw payload bytes.
Eof bool true when this frame marks end of stream.
.proto Type Notes Go Type
double float64
float float32
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64
uint32 Uses variable-length encoding. uint32
uint64 Uses variable-length encoding. uint64
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64
sfixed32 Always four bytes. int32
sfixed64 Always eight bytes. int64
bool bool
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string
bytes May contain any arbitrary sequence of bytes. []byte