model.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. }
  20. // GetObjectRequest The request of DoGetObject
  21. type GetObjectRequest struct {
  22. ObjectKey string
  23. }
  24. // GetObjectResult The result of DoGetObject
  25. type GetObjectResult struct {
  26. Response *Response
  27. ClientCRC hash.Hash64
  28. ServerCRC uint64
  29. }
  30. // AppendObjectRequest The requtest of DoAppendObject
  31. type AppendObjectRequest struct {
  32. ObjectKey string
  33. Reader io.Reader
  34. Position int64
  35. }
  36. // AppendObjectResult The result of DoAppendObject
  37. type AppendObjectResult struct {
  38. NextPosition int64
  39. CRC uint64
  40. }
  41. // UploadPartRequest The request of DoUploadPart
  42. type UploadPartRequest struct {
  43. InitResult *InitiateMultipartUploadResult
  44. Reader io.Reader
  45. PartSize int64
  46. PartNumber int
  47. }
  48. // UploadPartResult The result of DoUploadPart
  49. type UploadPartResult struct {
  50. Part UploadPart
  51. }