github.com/aliyun/aliyun-oss-go-sdk@v3.0.2+incompatible/oss/model.go (about) 1 package oss 2 3 import ( 4 "hash" 5 "io" 6 "net/http" 7 ) 8 9 // Response defines HTTP response from OSS 10 type Response struct { 11 StatusCode int 12 Headers http.Header 13 Body io.ReadCloser 14 ClientCRC uint64 15 ServerCRC uint64 16 } 17 18 func (r *Response) Read(p []byte) (n int, err error) { 19 return r.Body.Read(p) 20 } 21 22 // Close close http reponse body 23 func (r *Response) Close() error { 24 return r.Body.Close() 25 } 26 27 // PutObjectRequest is the request of DoPutObject 28 type PutObjectRequest struct { 29 ObjectKey string 30 Reader io.Reader 31 } 32 33 // GetObjectRequest is the request of DoGetObject 34 type GetObjectRequest struct { 35 ObjectKey string 36 } 37 38 // GetObjectResult is the result of DoGetObject 39 type GetObjectResult struct { 40 Response *Response 41 ClientCRC hash.Hash64 42 ServerCRC uint64 43 } 44 45 // AppendObjectRequest is the requtest of DoAppendObject 46 type AppendObjectRequest struct { 47 ObjectKey string 48 Reader io.Reader 49 Position int64 50 } 51 52 // AppendObjectResult is the result of DoAppendObject 53 type AppendObjectResult struct { 54 NextPosition int64 55 CRC uint64 56 } 57 58 // UploadPartRequest is the request of DoUploadPart 59 type UploadPartRequest struct { 60 InitResult *InitiateMultipartUploadResult 61 Reader io.Reader 62 PartSize int64 63 PartNumber int 64 } 65 66 // UploadPartResult is the result of DoUploadPart 67 type UploadPartResult struct { 68 Part UploadPart 69 }