@@ -272,10 +272,18 @@ func (s *ObjectService) Copy(ctx context.Context, name, sourceURL string, opt *O
272272 return & res , resp , err
273273}
274274
275+ type ObjectDeleteOptions struct {
276+ // SSE-C
277+ XCosSSECustomerAglo string `header:"x-cos-server-side-encryption-customer-algorithm,omitempty" url:"-" xml:"-"`
278+ XCosSSECustomerKey string `header:"x-cos-server-side-encryption-customer-key,omitempty" url:"-" xml:"-"`
279+ XCosSSECustomerKeyMD5 string `header:"x-cos-server-side-encryption-customer-key-MD5,omitempty" url:"-" xml:"-"`
280+ //兼容其他自定义头部
281+ XOptionHeader * http.Header `header:"-,omitempty" url:"-" xml:"-"`
282+ }
275283// Delete Object请求可以将一个文件(Object)删除。
276284//
277285// https://www.qcloud.com/document/product/436/7743
278- func (s * ObjectService ) Delete (ctx context.Context , name string ) (* Response , error ) {
286+ func (s * ObjectService ) Delete (ctx context.Context , name string , opt * ObjectDeleteOptions ) (* Response , error ) {
279287 // When use "" string might call the delete bucket interface
280288 if len (name ) == 0 {
281289 return nil , errors .New ("empty object name" )
@@ -285,6 +293,7 @@ func (s *ObjectService) Delete(ctx context.Context, name string) (*Response, err
285293 baseURL : s .client .BaseURL .BucketURL ,
286294 uri : "/" + encodeURIComponent (name ),
287295 method : http .MethodDelete ,
296+ optHeader : opt ,
288297 }
289298 resp , err := s .client .send (ctx , & sendOpt )
290299 return resp , err
0 commit comments