Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Commit 6bc6d8c

Browse files
authored
storage: Implement AOS-40 (#15)
Signed-off-by: Xuanwo <[email protected]>
1 parent 3cd4a50 commit 6bc6d8c

File tree

5 files changed

+39
-24
lines changed

5 files changed

+39
-24
lines changed

generated.go

Lines changed: 26 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ require (
66
github.com/Azure/azure-pipeline-go v0.2.3
77
github.com/Azure/azure-storage-blob-go v0.13.0
88
github.com/aos-dev/go-integration-test/v3 v3.0.0-20210205075620-0b779f4b3afc
9-
github.com/aos-dev/go-storage/v3 v3.5.1-0.20210422060150-bc0fae4c3fa7
9+
github.com/aos-dev/go-storage/v3 v3.5.1-0.20210423112617-6847a93345fd
1010
github.com/google/uuid v1.2.0
1111
)

go.sum

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@ github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935
1313
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
1414
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
1515
github.com/Xuanwo/templateutils v0.0.0-20201019101431-c73b871118f2/go.mod h1:x0qS7gfgEm24b8V9U+0zBEBAu/VpxZhO/+EWtpgEgDw=
16-
github.com/Xuanwo/templateutils v0.0.0-20201216100309-46f73cd4e4b1 h1:SQ8kQujQ0yl39YBMU0xZ+yyfxx/qSWfGWlCPNzHp5kw=
17-
github.com/Xuanwo/templateutils v0.0.0-20201216100309-46f73cd4e4b1/go.mod h1:x0qS7gfgEm24b8V9U+0zBEBAu/VpxZhO/+EWtpgEgDw=
16+
github.com/Xuanwo/templateutils v0.1.0 h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6UhntJY=
17+
github.com/Xuanwo/templateutils v0.1.0/go.mod h1:OdE0DJ+CJxDBq6psX5DPV+gOZi8bhuHuVUpPCG++Wb8=
1818
github.com/aos-dev/go-integration-test/v3 v3.0.0-20210205075620-0b779f4b3afc h1:s8BQqJwWe2yoTGJFOsIxnkwwMsnDqMgkO39yzEP4smw=
1919
github.com/aos-dev/go-integration-test/v3 v3.0.0-20210205075620-0b779f4b3afc/go.mod h1:2VqxZhJVvI1jKTTERWHfCBMZQaJt10xoEJ+CxbfYZlo=
2020
github.com/aos-dev/go-storage/v3 v3.0.1-0.20210205074802-e8a5b22166c2/go.mod h1:JznhvyhPDnETfZ3RyWm3mT/S5ic+uuYFWagSIkUZujc=
21-
github.com/aos-dev/go-storage/v3 v3.4.3-0.20210417162535-67db0dd18784 h1:eeKDDn+8RPtYuk7lrQC48OtTNeSRF/l9P5YHa/Q3omk=
22-
github.com/aos-dev/go-storage/v3 v3.4.3-0.20210417162535-67db0dd18784/go.mod h1:PZJT0Ta7YxVM5QoYoh8Q/X4I6e/z/7gOJqm85Aib4nY=
23-
github.com/aos-dev/go-storage/v3 v3.5.1-0.20210422060150-bc0fae4c3fa7 h1:YirUP3+06blEpQ/o6VT0RXRf5ystxNB91iaYgO0SoWM=
24-
github.com/aos-dev/go-storage/v3 v3.5.1-0.20210422060150-bc0fae4c3fa7/go.mod h1:JFshvl851ZDDXtFGWDFKqkg34QEPH0xuhLJ2LjikZYc=
21+
github.com/aos-dev/go-storage/v3 v3.5.1-0.20210423112617-6847a93345fd h1:FEBrz+fo4V+6jMxnbmkI0M+3m5MYriF5SijFF/Sz5cM=
22+
github.com/aos-dev/go-storage/v3 v3.5.1-0.20210423112617-6847a93345fd/go.mod h1:ZQwybmoCcTWUOWg+G15gT/NQJoI8G8KH1pF41TuJqYk=
2523
github.com/aos-dev/specs/go v0.0.0-20210205073047-af8ef94af73d/go.mod h1:XTNlLZtPA1inITyDH5hNnQXVjvvKUvo+lurs5GYB8NA=
26-
github.com/aos-dev/specs/go v0.0.0-20210312090615-23109627848b h1:qIehSnBbr31ATAckM9u9h6gSz+9PkGqu79vTngx6wPw=
27-
github.com/aos-dev/specs/go v0.0.0-20210312090615-23109627848b/go.mod h1:XTNlLZtPA1inITyDH5hNnQXVjvvKUvo+lurs5GYB8NA=
28-
github.com/aos-dev/specs/go v0.0.0-20210420062803-1a60efa2eae3 h1:LiW0Ki0Gw6opu11JwMhxWw5M+V6I9JypJ5eAIp+Rqt4=
29-
github.com/aos-dev/specs/go v0.0.0-20210420062803-1a60efa2eae3/go.mod h1:gNah3KaPJEfysh7uCCX+sYjQC3g2yx2VgBkFlT945Ws=
24+
github.com/aos-dev/specs/go v0.0.0-20210423110314-8361397c2bf3 h1:e65ozDhdfHfhnDpZF9SLcY5mwtAg/sAvNIUAkFd+4D0=
25+
github.com/aos-dev/specs/go v0.0.0-20210423110314-8361397c2bf3/go.mod h1:gNah3KaPJEfysh7uCCX+sYjQC3g2yx2VgBkFlT945Ws=
3026
github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY=
3127
github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU=
3228
github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ=
@@ -60,7 +56,6 @@ github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqf
6056
github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E=
6157
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
6258
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
63-
github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM=
6459
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
6560
github.com/pelletier/go-toml v1.9.0 h1:NOd0BRdOKpPf0SxkL3HxSQOG7rNh+4kl6PHcBPFs7Q0=
6661
github.com/pelletier/go-toml v1.9.0/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=

storage.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ func (s *Storage) stat(ctx context.Context, path string, opt pairStorageStat) (o
199199
o.SetContentMd5(base64.StdEncoding.EncodeToString(v))
200200
}
201201

202-
sm := make(map[string]string)
202+
var sm ObjectMetadata
203203
if v := output.AccessTier(); v != "" {
204-
sm[MetadataAccessTier] = v
204+
sm.AccessTier = v
205205
}
206206
if v := output.EncryptionKeySha256(); v != "" {
207-
sm[MetadataEncryptionKeySha256] = v
207+
sm.EncryptionKeySha256 = v
208208
}
209209
if v := output.EncryptionScope(); v != "" {
210-
sm[MetadataEncryptionScope] = v
210+
sm.EncryptionScope = v
211211
}
212212
o.SetServiceMetadata(sm)
213213

utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ func (s *Storage) formatFileObject(v azblob.BlobItemInternal) (o *typ.Object, er
290290
o.SetContentMd5(base64.StdEncoding.EncodeToString(v.Properties.ContentMD5))
291291
}
292292

293-
sm := make(map[string]string)
293+
var sm ObjectMetadata
294294
if value := v.Properties.AccessTier; value != "" {
295-
sm[MetadataAccessTier] = string(value)
295+
sm.AccessTier = string(value)
296296
}
297297
o.SetServiceMetadata(sm)
298298

0 commit comments

Comments
 (0)