v0.1.0
Format:
*<filename_size><filename><id><size><data>
Where:
filename_size
is a little-endian uint64id
is a little-endian uint64size
is a little-endian uint64filename
is []byte with len offilename_size
, containing the name of uploading filedata
is []byte with len ofsize
containing theid
'th chunk of file
<code><msg_size>[<msg>]
Where:
code
is the little-endian uint64 status code (see Status Codes)msg_size
is the little-endian uint64 representing the size of followingmsg
. Ifmsg
not present, themsg_size
will be0
Request specified chunk of the file.
Format:
/<filename_size><filename><id>
Where:
filename_size
is a little-endian uint64id
is a little-endian uint64 ID of file chunkfilename
is []byte with len offilename_size
, containing the name of uploading file
Depends on the code
<code><filename_size><filename><id><size><data>
The part after code
is identical to send chunk request
<code>
<code><msg_size>[<msg>]
Where:
msg_size
is the little-endian uint64 representing the size of followingmsg
. Ifmsg
not present, themsg_size
will be0
Request specific chunks of the file.
Format:
%<filename_size><filename>
Where:
filename_size
is a little-endian uint64filename
is []byte with len offilename_size
, containing the name of uploading file
<code><count>[<...ids>]
Where:
count
is a little-endian uint64 representing count of following chunk IDs...ids
is a sequence (len =count
) of little-endian uint64, representing ids of chunks stored in node
If there is no chunks in the node, the count
will be 0
and there will be no ids after that. The code
still will be OK
<code><msg_size>[<msg>]
Where:
msg_size
is the little-endian uint64 representing the size of followingmsg
. Ifmsg
not present, themsg_size
will be0
If the request will not match to any of specified requests, the server will return INVALID_REQ
code in following format:
<code><msg_size>[<msg>]
Where:
msg_size
is the little-endian uint64 representing the size of followingmsg
. Ifmsg
not present, themsg_size
will be0
Status code is a little-endian uint64 with following meanings:
10
- OK20
- NOT_FOUND21
- INVALID_REQ30
- INTERNAL
I don't know