message_types.go 851 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package protocol
  2. type IndexMessage struct {
  3. Repository string // max:64
  4. Files []FileInfo // max:100000
  5. }
  6. type FileInfo struct {
  7. Name string // max:1024
  8. Flags uint32
  9. Modified int64
  10. Version uint64
  11. Blocks []BlockInfo // max:100000
  12. }
  13. type BlockInfo struct {
  14. Size uint32
  15. Hash []byte // max:64
  16. }
  17. type RequestMessage struct {
  18. Repository string // max:64
  19. Name string // max:1024
  20. Offset uint64
  21. Size uint32
  22. }
  23. type ClusterConfigMessage struct {
  24. ClientName string // max:64
  25. ClientVersion string // max:64
  26. Repositories []Repository // max:64
  27. Options []Option // max:64
  28. }
  29. type Repository struct {
  30. ID string // max:64
  31. Nodes []Node // max:64
  32. }
  33. type Node struct {
  34. ID string // max:64
  35. Flags uint32
  36. }
  37. type Option struct {
  38. Key string // max:64
  39. Value string // max:1024
  40. }