Add fields for future extensibility

This adds a number of fields to the end of existing messages. This is a
backwards compatible change.
This commit is contained in:
Jakob Borg
2015-01-08 10:28:39 +01:00
parent ce3e6e084c
commit b88e3c99c1
3 changed files with 113 additions and 11 deletions

View File

@@ -21,8 +21,10 @@ package protocol
import "fmt"
type IndexMessage struct {
Folder string // max:64
Files []FileInfo
Folder string // max:64
Files []FileInfo
Flags uint32
Options []Option // max:64
}
type FileInfo struct {
@@ -150,14 +152,18 @@ func (b BlockInfo) String() string {
}
type RequestMessage struct {
Folder string // max:64
Name string // max:8192
Offset uint64
Size uint32
Folder string // max:64
Name string // max:8192
Offset uint64
Size uint32
Hash []byte // max:64
Flags uint32
Options []Option // max:64
}
type ResponseMessage struct {
Data []byte
Data []byte
Error uint32
}
type ClusterConfigMessage struct {
@@ -194,6 +200,7 @@ type Option struct {
type CloseMessage struct {
Reason string // max:1024
Code uint32
}
type EmptyMessage struct{}