mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
xl: refactor functions to xl-v1-common.go xl-v1-utils.go. (#1357)
This commit is contained in:
committed by
Harshavardhana
parent
becc814531
commit
8c85815106
@@ -96,6 +96,25 @@ func (f fileMetadata) GetModTime() (time.Time, error) {
|
||||
return time.Parse(timeFormatAMZ, timeStrs[0])
|
||||
}
|
||||
|
||||
// Set file Modification time.
|
||||
func (f fileMetadata) SetModTime(modTime time.Time) {
|
||||
f.Set("file.modTime", modTime.Format(timeFormatAMZ))
|
||||
}
|
||||
|
||||
// Get file version.
|
||||
func (f fileMetadata) GetFileVersion() (int64, error) {
|
||||
version := f.Get("file.version")
|
||||
if version == nil {
|
||||
return 0, errMetadataKeyNotExist
|
||||
}
|
||||
return strconv.ParseInt(version[0], 10, 64)
|
||||
}
|
||||
|
||||
// Set file version.
|
||||
func (f fileMetadata) SetFileVersion(fileVersion int64) {
|
||||
f.Set("file.version", strconv.FormatInt(fileVersion, 10))
|
||||
}
|
||||
|
||||
// fileMetadataDecode - file metadata decode.
|
||||
func fileMetadataDecode(reader io.Reader) (fileMetadata, error) {
|
||||
metadata := make(fileMetadata)
|
||||
|
||||
Reference in New Issue
Block a user