@@ -41,7 +41,7 @@ var ObjectList = func(containerURL azblob.ContainerURL, bucketName string) ([]*m
41
41
blobResponse , err := containerURL .ListBlobsFlatSegment (context .Background (), azblob.Marker {}, azblob.ListBlobsSegmentOptions {})
42
42
43
43
if err != nil {
44
- log .Fatal ( err )
44
+ log .Errorf ( "unable to list objects. failed with error: %v" , err )
45
45
}
46
46
47
47
for _ , blob := range blobResponse .Segment .BlobItems {
@@ -59,14 +59,33 @@ var ObjectList = func(containerURL azblob.ContainerURL, bucketName string) ([]*m
59
59
obj .RedirectLocation = * blob .Properties .DestinationSnapshot
60
60
}
61
61
62
+ if blob .VersionID != nil {
63
+ obj .VersionId = * blob .VersionID
64
+ }
65
+
66
+ tagset := map [string ]string {}
67
+
68
+ if blob .BlobTags != nil {
69
+ for _ , tag := range blob .BlobTags .BlobTagSet {
70
+ tagset [tag .Key ] = tag .Value
71
+ }
72
+ obj .ObjectTags = tagset
73
+ }
74
+
75
+ obj .ExpiresDate = blob .Properties .ExpiresOn
76
+
77
+ if blob .Properties .EncryptionScope != nil {
78
+ obj .ServerSideEncryption = * blob .Properties .EncryptionScope
79
+ }
80
+
62
81
obj .ReplicationStatus = string (blob .Properties .CopyStatus )
63
82
64
83
if blob .Properties .ContentType != nil {
65
84
obj .ObjectType = * blob .Properties .ContentType
66
85
}
67
- props , err := blobURL .GetProperties (context .Background (), azblob.BlobAccessConditions {})
86
+ props , err := blobURL .GetProperties (context .Background (), azblob.BlobAccessConditions {}, azblob. ClientProvidedKeyOptions {} )
68
87
if err != nil {
69
- log .Error ("get properties failed" , err )
88
+ log .Error ("unable to get properties for object %v. failed with error: %v" , obj . ObjectName , err )
70
89
}
71
90
72
91
obj .Metadata = props .NewMetadata ()
@@ -101,7 +120,7 @@ func GetBucketMeta(idx int, container azblob.ContainerItem, serviceURL azblob.Se
101
120
props , err := containerURL .GetProperties (context .Background (), azblob.LeaseAccessConditions {})
102
121
103
122
if err != nil {
104
- log .Errorf ("failed to get bucket tags. failed wth error: %v" , err )
123
+ log .Errorf ("unable to get bucket tags. failed wth error: %v" , err )
105
124
} else {
106
125
buck .BucketTags = props .NewMetadata ()
107
126
}
@@ -116,7 +135,7 @@ func GetBucketMeta(idx int, container azblob.ContainerItem, serviceURL azblob.Se
116
135
for _ , item := range acl .Items {
117
136
acc := & model.Access {}
118
137
acc .ID = item .ID
119
- acc .Permission = item .AccessPolicy .Permission
138
+ acc .Permission = * item .AccessPolicy .Permission
120
139
access = append (access , acc )
121
140
}
122
141
buck .BucketAcl = access
0 commit comments