mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
weed s3: generate time format acceptable by aws cli s3
fix https://github.com/chrislusf/seaweedfs/issues/911
This commit is contained in:
parent
2a52e70a41
commit
78b9db34d5
3
weed/s3api/custom_types.go
Normal file
3
weed/s3api/custom_types.go
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
package s3api
|
||||||
|
|
||||||
|
const s3TimeFormat = "2006-01-02T15:04:05.999Z07:00"
|
|
@ -131,8 +131,8 @@ func (s3a *S3ApiServer) listFilerEntries(ctx context.Context, bucket, originalPr
|
||||||
ETag: "\"" + filer2.ETag(entry.Chunks) + "\"",
|
ETag: "\"" + filer2.ETag(entry.Chunks) + "\"",
|
||||||
Size: int64(filer2.TotalSize(entry.Chunks)),
|
Size: int64(filer2.TotalSize(entry.Chunks)),
|
||||||
Owner: CanonicalUser{
|
Owner: CanonicalUser{
|
||||||
ID: "bcaf161ca5fb16fd081034f",
|
ID: fmt.Sprintf("%x", entry.Attributes.Uid),
|
||||||
DisplayName: "webfile",
|
DisplayName: entry.Attributes.UserName,
|
||||||
},
|
},
|
||||||
StorageClass: "STANDARD",
|
StorageClass: "STANDARD",
|
||||||
})
|
})
|
||||||
|
@ -151,7 +151,7 @@ func (s3a *S3ApiServer) listFilerEntries(ctx context.Context, bucket, originalPr
|
||||||
CommonPrefixes: commonPrefixes,
|
CommonPrefixes: commonPrefixes,
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.V(4).Infof("read directory: %v, found: %v", request, counter)
|
glog.V(4).Infof("read directory: %v, found: %v, %+v", request, counter, response)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
|
@ -966,10 +966,10 @@ func (b xsdBase64Binary) MarshalText() ([]byte, error) {
|
||||||
type xsdDateTime time.Time
|
type xsdDateTime time.Time
|
||||||
|
|
||||||
func (t *xsdDateTime) UnmarshalText(text []byte) error {
|
func (t *xsdDateTime) UnmarshalText(text []byte) error {
|
||||||
return _unmarshalTime(text, (*time.Time)(t), "2006-01-02T15:04:05.999999999")
|
return _unmarshalTime(text, (*time.Time)(t), s3TimeFormat)
|
||||||
}
|
}
|
||||||
func (t xsdDateTime) MarshalText() ([]byte, error) {
|
func (t xsdDateTime) MarshalText() ([]byte, error) {
|
||||||
return []byte((time.Time)(t).Format("2006-01-02T15:04:05.999999999")), nil
|
return []byte((time.Time)(t).Format(s3TimeFormat)), nil
|
||||||
}
|
}
|
||||||
func (t xsdDateTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
func (t xsdDateTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
||||||
if (time.Time)(t).IsZero() {
|
if (time.Time)(t).IsZero() {
|
||||||
|
|
Loading…
Reference in a new issue