You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

object.go 2.9 kB

5 years ago
5 years ago
5 years ago
5 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package minio_ext
  2. import (
  3. "net/http"
  4. "net/url"
  5. "time"
  6. )
  7. // StringMap represents map with custom UnmarshalXML
  8. type StringMap map[string]string
  9. // CommonPrefix container for prefix response.
  10. type CommonPrefix struct {
  11. Prefix string
  12. }
  13. // ObjectInfo container for object metadata.
  14. type ObjectInfo struct {
  15. // An ETag is optionally set to md5sum of an object. In case of multipart objects,
  16. // ETag is of the form MD5SUM-N where MD5SUM is md5sum of all individual md5sums of
  17. // each parts concatenated into one string.
  18. ETag string `json:"etag"`
  19. Key string `json:"name"` // Name of the object
  20. LastModified time.Time `json:"lastModified"` // Date and time the object was last modified.
  21. Size int64 `json:"size"` // Size in bytes of the object.
  22. ContentType string `json:"contentType"` // A standard MIME type describing the format of the object data.
  23. Expires time.Time `json:"expires"` // The date and time at which the object is no longer able to be cached.
  24. // Collection of additional metadata on the object.
  25. // eg: x-amz-meta-*, content-encoding etc.
  26. Metadata http.Header `json:"metadata" xml:"-"`
  27. // x-amz-meta-* headers stripped "x-amz-meta-" prefix containing the first value.
  28. UserMetadata StringMap `json:"userMetadata"`
  29. // Owner name.
  30. Owner struct {
  31. DisplayName string `json:"name"`
  32. ID string `json:"id"`
  33. } `json:"owner"`
  34. // The class of storage used to store the object.
  35. StorageClass string `json:"storageClass"`
  36. // Error
  37. Err error `json:"-"`
  38. }
  39. // ListBucketResult container for listObjects response.
  40. type ListBucketResult struct {
  41. // A response can contain CommonPrefixes only if you have
  42. // specified a delimiter.
  43. CommonPrefixes []CommonPrefix
  44. // Metadata about each object returned.
  45. Contents []ObjectInfo
  46. Delimiter string
  47. // Encoding type used to encode object keys in the response.
  48. EncodingType string
  49. // A flag that indicates whether or not ListObjects returned all of the results
  50. // that satisfied the search criteria.
  51. IsTruncated bool
  52. Marker string
  53. MaxKeys int64
  54. Name string
  55. // When response is truncated (the IsTruncated element value in
  56. // the response is true), you can use the key name in this field
  57. // as marker in the subsequent request to get next set of objects.
  58. // Object storage lists objects in alphabetical order Note: This
  59. // element is returned only if you have delimiter request
  60. // parameter specified. If response does not include the NextMaker
  61. // and it is truncated, you can use the value of the last Key in
  62. // the response as the marker in the subsequent request to get the
  63. // next set of object keys.
  64. NextMarker string
  65. Prefix string
  66. }
  67. var (
  68. // Hex encoded string of nil sha256sum bytes.
  69. emptySHA256Hex = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  70. // Sentinel URL is the default url value which is invalid.
  71. sentinelURL = url.URL{}
  72. )