@@ -32,6 +32,12 @@ import (
32
32
// to update tag(s) of a specific object version
33
33
type PutObjectTaggingOptions struct {
34
34
VersionID string
35
+ Internal AdvancedObjectTaggingOptions
36
+ }
37
+
38
+ // AdvancedObjectTaggingOptions for internal use by MinIO server - not intended for client use.
39
+ type AdvancedObjectTaggingOptions struct {
40
+ ReplicationProxyRequest string
35
41
}
36
42
37
43
// PutObjectTagging replaces or creates object tag(s) and can target
@@ -50,7 +56,10 @@ func (c *Client) PutObjectTagging(ctx context.Context, bucketName, objectName st
50
56
if opts .VersionID != "" {
51
57
urlValues .Set ("versionId" , opts .VersionID )
52
58
}
53
-
59
+ headers := make (http.Header , 0 )
60
+ if opts .Internal .ReplicationProxyRequest != "" {
61
+ headers .Set (minIOBucketReplicationProxyRequest , opts .Internal .ReplicationProxyRequest )
62
+ }
54
63
reqBytes , err := xml .Marshal (otags )
55
64
if err != nil {
56
65
return err
@@ -63,6 +72,7 @@ func (c *Client) PutObjectTagging(ctx context.Context, bucketName, objectName st
63
72
contentBody : bytes .NewReader (reqBytes ),
64
73
contentLength : int64 (len (reqBytes )),
65
74
contentMD5Base64 : sumMD5Base64 (reqBytes ),
75
+ customHeader : headers ,
66
76
}
67
77
68
78
// Execute PUT to set a object tagging.
@@ -83,6 +93,7 @@ func (c *Client) PutObjectTagging(ctx context.Context, bucketName, objectName st
83
93
// to fetch the tagging key/value pairs
84
94
type GetObjectTaggingOptions struct {
85
95
VersionID string
96
+ Internal AdvancedObjectTaggingOptions
86
97
}
87
98
88
99
// GetObjectTagging fetches object tag(s) with options to target
@@ -96,12 +107,16 @@ func (c *Client) GetObjectTagging(ctx context.Context, bucketName, objectName st
96
107
if opts .VersionID != "" {
97
108
urlValues .Set ("versionId" , opts .VersionID )
98
109
}
99
-
110
+ headers := make (http.Header , 0 )
111
+ if opts .Internal .ReplicationProxyRequest != "" {
112
+ headers .Set (minIOBucketReplicationProxyRequest , opts .Internal .ReplicationProxyRequest )
113
+ }
100
114
// Execute GET on object to get object tag(s)
101
115
resp , err := c .executeMethod (ctx , http .MethodGet , requestMetadata {
102
- bucketName : bucketName ,
103
- objectName : objectName ,
104
- queryValues : urlValues ,
116
+ bucketName : bucketName ,
117
+ objectName : objectName ,
118
+ queryValues : urlValues ,
119
+ customHeader : headers ,
105
120
})
106
121
107
122
defer closeResponse (resp )
@@ -121,6 +136,7 @@ func (c *Client) GetObjectTagging(ctx context.Context, bucketName, objectName st
121
136
// RemoveObjectTaggingOptions holds the version id of the object to remove
122
137
type RemoveObjectTaggingOptions struct {
123
138
VersionID string
139
+ Internal AdvancedObjectTaggingOptions
124
140
}
125
141
126
142
// RemoveObjectTagging removes object tag(s) with options to control a specific object
@@ -134,12 +150,16 @@ func (c *Client) RemoveObjectTagging(ctx context.Context, bucketName, objectName
134
150
if opts .VersionID != "" {
135
151
urlValues .Set ("versionId" , opts .VersionID )
136
152
}
137
-
153
+ headers := make (http.Header , 0 )
154
+ if opts .Internal .ReplicationProxyRequest != "" {
155
+ headers .Set (minIOBucketReplicationProxyRequest , opts .Internal .ReplicationProxyRequest )
156
+ }
138
157
// Execute DELETE on object to remove object tag(s)
139
158
resp , err := c .executeMethod (ctx , http .MethodDelete , requestMetadata {
140
- bucketName : bucketName ,
141
- objectName : objectName ,
142
- queryValues : urlValues ,
159
+ bucketName : bucketName ,
160
+ objectName : objectName ,
161
+ queryValues : urlValues ,
162
+ customHeader : headers ,
143
163
})
144
164
145
165
defer closeResponse (resp )
0 commit comments