forked from TrueCloudLab/frostfs-s3-gw
[#119] Add null versioning and handler
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
cc0e2e7636
commit
aac1ac2868
6 changed files with 260 additions and 11 deletions
|
@ -53,6 +53,34 @@ type (
|
|||
// List of prefixes for this request.
|
||||
Prefixes []string
|
||||
}
|
||||
|
||||
// ObjectVersionInfo stores info about objects versions.
|
||||
ObjectVersionInfo struct {
|
||||
Object *ObjectInfo
|
||||
IsLatest bool
|
||||
VersionID string
|
||||
}
|
||||
|
||||
// DeletedObjectInfo stores info about deleted versions of objects.
|
||||
DeletedObjectInfo struct {
|
||||
Owner *owner.ID
|
||||
Key string
|
||||
VersionID string
|
||||
IsLatest bool
|
||||
LastModified string
|
||||
}
|
||||
|
||||
// ListObjectVersionsInfo stores info and list of objects' versions.
|
||||
ListObjectVersionsInfo struct {
|
||||
CommonPrefixes []*string
|
||||
IsTruncated bool
|
||||
KeyMarker string
|
||||
NextKeyMarker string
|
||||
NextVersionIDMarker string
|
||||
Version []*ObjectVersionInfo
|
||||
DeleteMarker []*DeletedObjectInfo
|
||||
VersionIDMarker string
|
||||
}
|
||||
)
|
||||
|
||||
// PathSeparator is a path components separator string.
|
||||
|
@ -123,6 +151,14 @@ func objectInfoFromMeta(bkt *BucketInfo, meta *object.Object, prefix, delimiter
|
|||
}
|
||||
}
|
||||
|
||||
func objectVersionInfoFromMeta(bkt *BucketInfo, meta *object.Object, prefix, delimiter string) *ObjectVersionInfo {
|
||||
oi := objectInfoFromMeta(bkt, meta, prefix, delimiter)
|
||||
if oi == nil {
|
||||
return nil
|
||||
}
|
||||
return &ObjectVersionInfo{Object: oi, IsLatest: true, VersionID: unversionedObjectVersionID}
|
||||
}
|
||||
|
||||
func filenameFromObject(o *object.Object) string {
|
||||
var name = o.ID().String()
|
||||
for _, attr := range o.Attributes() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue