forked from TrueCloudLab/frostfs-s3-gw
[#180] api: Format object_list.go
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
afff616675
commit
7291b81040
1 changed files with 10 additions and 13 deletions
|
@ -37,9 +37,8 @@ func encodeV1(p *layer.ListObjectsParamsV1, list *layer.ListObjectsInfoV1) *List
|
||||||
Prefix: p.Prefix,
|
Prefix: p.Prefix,
|
||||||
MaxKeys: p.MaxKeys,
|
MaxKeys: p.MaxKeys,
|
||||||
Delimiter: p.Delimiter,
|
Delimiter: p.Delimiter,
|
||||||
|
IsTruncated: list.IsTruncated,
|
||||||
IsTruncated: list.IsTruncated,
|
NextMarker: list.NextMarker,
|
||||||
NextMarker: list.NextMarker,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
res.CommonPrefixes = fillPrefixes(list.Prefixes, p.Encode)
|
res.CommonPrefixes = fillPrefixes(list.Prefixes, p.Encode)
|
||||||
|
@ -71,16 +70,14 @@ func (h *handler) ListObjectsV2Handler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
func encodeV2(p *layer.ListObjectsParamsV2, list *layer.ListObjectsInfoV2) *ListObjectsV2Response {
|
func encodeV2(p *layer.ListObjectsParamsV2, list *layer.ListObjectsInfoV2) *ListObjectsV2Response {
|
||||||
res := &ListObjectsV2Response{
|
res := &ListObjectsV2Response{
|
||||||
Name: p.Bucket,
|
Name: p.Bucket,
|
||||||
EncodingType: p.Encode,
|
EncodingType: p.Encode,
|
||||||
Prefix: s3PathEncode(p.Prefix, p.Encode),
|
Prefix: s3PathEncode(p.Prefix, p.Encode),
|
||||||
KeyCount: len(list.Objects) + len(list.Prefixes),
|
KeyCount: len(list.Objects) + len(list.Prefixes),
|
||||||
MaxKeys: p.MaxKeys,
|
MaxKeys: p.MaxKeys,
|
||||||
Delimiter: s3PathEncode(p.Delimiter, p.Encode),
|
Delimiter: s3PathEncode(p.Delimiter, p.Encode),
|
||||||
StartAfter: s3PathEncode(p.StartAfter, p.Encode),
|
StartAfter: s3PathEncode(p.StartAfter, p.Encode),
|
||||||
|
IsTruncated: list.IsTruncated,
|
||||||
IsTruncated: list.IsTruncated,
|
|
||||||
|
|
||||||
ContinuationToken: p.ContinuationToken,
|
ContinuationToken: p.ContinuationToken,
|
||||||
NextContinuationToken: list.NextContinuationToken,
|
NextContinuationToken: list.NextContinuationToken,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue