github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/proto/objectserver/messages.go (about) 1 package objectserver 2 3 import ( 4 "github.com/Cloud-Foundations/Dominator/lib/hash" 5 "time" 6 ) 7 8 // The AddObjects() RPC requires the client to send a stream of AddObjectRequest 9 // objects in Gob format. To signify the end of the stream, the client should 10 // send an AddObjectRequest object with .Length == 0. 11 // The server will send one AddObjectResponse for each AddObjectRequest, but it 12 // will not flush the connection until the client signals the end of the stream. 13 type AddObjectRequest struct { 14 Length uint64 15 ExpectedHash *hash.Hash 16 } // Object data are streamed afterwards. 17 18 type AddObjectResponse struct { 19 ErrorString string 20 Hash hash.Hash 21 Added bool // If true: object was added, else object already existed. 22 } 23 24 type CheckObjectsRequest struct { 25 Hashes []hash.Hash 26 } 27 28 type CheckObjectsResponse struct { 29 ObjectSizes []uint64 // size == 0: object not found. 30 } 31 32 // This is used in the special GetObjects streaming HTTP/RPC protocol. 33 type GetObjectsRequest struct { 34 Exclusive bool // For initial performance benchmarking only. 35 Hashes []hash.Hash 36 } 37 38 type GetObjectsResponse struct { 39 ResponseString string 40 ObjectSizes []uint64 41 } // Object datas are streamed afterwards. 42 43 type TestBandwidthRequest struct { 44 Duration time.Duration // Ignored when sending to server. 45 ChunkSize uint // Maximum permitted: 65535. 46 SendToServer bool 47 } // The transmitter sends chunks of random data with a marker byte after each. 48 // If the marker byte is zero, no more chunks are sent and the response 49 // message is sent. 50 51 type TestBandwidthResponse struct { 52 ServerDuration time.Duration 53 }