File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import (
24
24
"context"
25
25
"fmt"
26
26
"io"
27
+ "net/http"
27
28
"os"
28
29
"strings"
29
30
"sync"
@@ -70,6 +71,14 @@ type SnowballObject struct {
70
71
// Exactly 'Size' number of bytes must be provided.
71
72
Content io.Reader
72
73
74
+ // VersionID of the object; if empty, a new versionID will be generated
75
+ VersionID string
76
+
77
+ // Headers contains more options for this object upload, the same as you
78
+ // would include in a regular PutObject operation, such as user metadata
79
+ // and content-disposition, expires, ..
80
+ Headers http.Header
81
+
73
82
// Close will be called when an object has finished processing.
74
83
// Note that if PutObjectsSnowball returns because of an error,
75
84
// objects not consumed from the input will NOT have been closed.
@@ -181,6 +190,14 @@ objectLoop:
181
190
header .ModTime = time .Now ().UTC ()
182
191
}
183
192
193
+ header .PAXRecords = make (map [string ]string )
194
+ if obj .VersionID != "" {
195
+ header .PAXRecords ["minio.versionId" ] = obj .VersionID
196
+ }
197
+ for k , vals := range obj .Headers {
198
+ header .PAXRecords ["minio.metadata." + k ] = strings .Join (vals , "," )
199
+ }
200
+
184
201
if err := t .WriteHeader (& header ); err != nil {
185
202
closeObj ()
186
203
return err
You can’t perform that action at this time.
0 commit comments