func (client *Client) CopyObjectWithContext(ctx context.Context, request *CopyObjectRequest) error {
	dataString := map[string]string{
		"srcBucketName": request.SourceBucketName,
		"srcObjectName": request.SourceObjectName,
	}

	data, e := json.Marshal(dataString)
	if e != nil {
		return e
	}

	req := &clientRequest{
		BucketName:         request.TargetBucketName,
		ObjectName:         request.TargetObjectName,
		QueryHeaderOptions: request,
		Method:             HTTPPut,
		Data:               bytes.NewReader(data),
	}

	resp, err := client.do(ctx, req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	return nil
}
// CopyObjectWithContext copy object from a bucket to other bucket with context controlling
CopyObjectWithContext copy object from a bucket to other bucket with context controlling
// CopyObjectWithContext copy object from a bucket to other bucket with context controlling
func (client *Client) CopyObjectWithContext(ctx context.Context, request *CopyObjectRequest) error {
	dataString := map[string]string{
		"srcBucketName": request.SourceBucketName,
		"srcObjectName": request.SourceObjectName,
	}
	data, e := json.Marshal(dataString)
	if e != nil {
		return e
	}
	req := &clientRequest{
		BucketName:         request.TargetBucketName,
		ObjectName:         request.TargetObjectName,
		QueryHeaderOptions: request,
		Method:             HTTPPut,
		Data:               bytes.NewReader(data),
	}
	resp, err := client.do(ctx, req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	return nil
}
func ( client * Client ) CopyObjectWithContext ( ctx context . Context , request * CopyObjectRequest ) error { dataString := map [ string ] string { " " : request . SourceBucketName , " " : request . SourceObjectName , } data , e := json . Marshal ( dataString ) if e != nil { return e } req := & clientRequest { BucketName : request . TargetBucketName , ObjectName : request . TargetObjectName , QueryHeaderOptions : request , Method : HTTPPut , Data : bytes . NewReader ( data ) , } resp , err := client . do ( ctx , req ) if err != nil { return err } defer resp . Body . Close ( ) return nil }
CopyObjectWithContext copy object from a bucket to other bucket with context controlling
CopyObjectWithContext copy object from a bucket to other bucket with context controlling