mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 20:50:22 +03:00
move versionsOrder struct to xl-storage-utils
This commit is contained in:
@@ -20,6 +20,20 @@ import (
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
)
|
||||
|
||||
type versionsSorter []FileInfo
|
||||
|
||||
func (v versionsSorter) Len() int { return len(v) }
|
||||
func (v versionsSorter) Swap(i, j int) { v[i], v[j] = v[j], v[i] }
|
||||
func (v versionsSorter) Less(i, j int) bool {
|
||||
if v[i].IsLatest {
|
||||
return true
|
||||
}
|
||||
if v[j].IsLatest {
|
||||
return false
|
||||
}
|
||||
return v[i].ModTime.After(v[j].ModTime)
|
||||
}
|
||||
|
||||
func getFileInfoVersions(xlMetaBuf []byte, volume, path string) (FileInfoVersions, error) {
|
||||
if isXL2V1Format(xlMetaBuf) {
|
||||
var xlMeta xlMetaV2
|
||||
|
||||
Reference in New Issue
Block a user