Skip to content

Commit 9bcf9fb

Browse files
committed
chore: add size to iter with attributes
1 parent 4e5fd42 commit 9bcf9fb

File tree

6 files changed

+6
-1
lines changed

6 files changed

+6
-1
lines changed

objstore.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ type ObjectAttributes struct {
284284

285285
type IterObjectAttributes struct {
286286
Name string
287+
Size int64
287288
lastModified time.Time
288289
}
289290

providers/azure/azure.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ func (b *Bucket) IterWithAttributes(ctx context.Context, dir string, f func(attr
232232
for _, blob := range resp.Segment.BlobItems {
233233
attrs := objstore.IterObjectAttributes{
234234
Name: *blob.Name,
235+
Size: *blob.Properties.ContentLength,
235236
}
236237
if params.LastModified {
237238
attrs.SetLastModified(*blob.Properties.LastModified)

providers/bos/bos.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ func (b *Bucket) IterWithAttributes(ctx context.Context, dir string, f func(attr
219219
for _, object := range objects.Contents {
220220
attrs := objstore.IterObjectAttributes{
221221
Name: object.Key,
222+
Size: int64(object.Size),
222223
}
223224

224225
if params.LastModified && object.LastModified != "" {

providers/filesystem/filesystem.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ func (b *Bucket) IterWithAttributes(ctx context.Context, dir string, f func(attr
112112

113113
attrs := objstore.IterObjectAttributes{
114114
Name: name,
115+
Size: info.Size(),
115116
}
116117
if params.LastModified {
117118
absPath := filepath.Join(absDir, file.Name())

providers/gcs/gcs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func (b *Bucket) IterWithAttributes(ctx context.Context, dir string, f func(attr
244244
return err
245245
}
246246

247-
objAttrs := objstore.IterObjectAttributes{Name: attrs.Prefix + attrs.Name}
247+
objAttrs := objstore.IterObjectAttributes{Name: attrs.Prefix + attrs.Name, Size: attrs.Size}
248248
if appliedOpts.LastModified {
249249
objAttrs.SetLastModified(attrs.Updated)
250250
}

providers/s3/s3.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ func (b *Bucket) IterWithAttributes(ctx context.Context, dir string, f func(attr
430430

431431
attr := objstore.IterObjectAttributes{
432432
Name: object.Key,
433+
Size: object.Size,
433434
}
434435
if appliedOpts.LastModified {
435436
attr.SetLastModified(object.LastModified)

0 commit comments

Comments
 (0)