model.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package oss
  2. import (
  3. "hash"
  4. "io"
  5. "net/http"
  6. )
  7. // Response Http response from oss
  8. type Response struct {
  9. StatusCode int
  10. Headers http.Header
  11. Body io.ReadCloser
  12. ClientCRC uint64
  13. ServerCRC uint64
  14. }
  15. // PutObjectRequest The request of DoPutObject
  16. type PutObjectRequest struct {
  17. ObjectKey string
  18. Reader io.Reader
  19. Listener ProgressListener
  20. }
  21. // GetObjectRequest The request of DoGetObject
  22. type GetObjectRequest struct {
  23. ObjectKey string
  24. Listener ProgressListener
  25. }
  26. // GetObjectResult The result of DoGetObject
  27. type GetObjectResult struct {
  28. Response *Response
  29. ClientCRC hash.Hash64
  30. ServerCRC uint64
  31. }
  32. // AppendObjectRequest The requtest of DoAppendObject
  33. type AppendObjectRequest struct {
  34. ObjectKey string
  35. Reader io.Reader
  36. Position int64
  37. Listener ProgressListener
  38. }
  39. // AppendObjectResult The result of DoAppendObject
  40. type AppendObjectResult struct {
  41. NextPosition int64
  42. CRC uint64
  43. }
  44. // UploadPartRequest The request of DoUploadPart
  45. type UploadPartRequest struct {
  46. InitResult *InitiateMultipartUploadResult
  47. Reader io.Reader
  48. PartSize int64
  49. PartNumber int
  50. Listener ProgressListener
  51. }
  52. // UploadPartResult The result of DoUploadPart
  53. type UploadPartResult struct {
  54. Part UploadPart
  55. }