message_types.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright (C) 2014 Jakob Borg and other contributors. All rights reserved.
  2. // Use of this source code is governed by an MIT-style license that can be
  3. // found in the LICENSE file.
  4. package protocol
  5. type IndexMessage struct {
  6. Repository string // max:64
  7. Files []FileInfo // max:1000000
  8. }
  9. type FileInfo struct {
  10. Name string // max:1024
  11. Flags uint32
  12. Modified int64
  13. Version uint64
  14. Blocks []BlockInfo // max:100000
  15. }
  16. type BlockInfo struct {
  17. Size uint32
  18. Hash []byte // max:64
  19. }
  20. type RequestMessage struct {
  21. Repository string // max:64
  22. Name string // max:1024
  23. Offset uint64
  24. Size uint32
  25. }
  26. type ClusterConfigMessage struct {
  27. ClientName string // max:64
  28. ClientVersion string // max:64
  29. Repositories []Repository // max:64
  30. Options []Option // max:64
  31. }
  32. type Repository struct {
  33. ID string // max:64
  34. Nodes []Node // max:64
  35. }
  36. type Node struct {
  37. ID string // max:64
  38. Flags uint32
  39. MaxVersion uint64
  40. }
  41. type Option struct {
  42. Key string // max:64
  43. Value string // max:1024
  44. }