// RemoveUpload implementation for Google Cloud Storage Data Backend
// Iterates on each upload file and call RemoveFile
RemoveUpload implementation for Google Cloud Storage Data Backend
Iterates on each upload file and call RemoveFile
// RemoveUpload implementation for Google Cloud Storage Data Backend // Iterates on each upload file and call RemoveFile
func (sb *Backend) RemoveUpload(ctx *juliet.Context, upload *common.Upload) (err error) {
	err = sb.initClient()
	if err != nil {
		err = fmt.Errorf("unable to get gcs client: %s", err)
		return
	}
	for _, file := range upload.Files {
		uuid := sb.getFileID(file.UploadID, file.ID)
		err = sb.client.Bucket(sb.Config.Bucket).Object(uuid).Delete(context.Background())
		if err != nil {
			if err == storage.ErrObjectNotExist {
				err = nil
			} else {
				return fmt.Errorf("unable to remove object %s : %s", uuid, err)
			}
		}
	}
	return
}
func ( sb * Backend ) RemoveUpload ( ctx * juliet . Context , upload * common . Upload ) ( err error ) { err = sb . initClient ( ) if err != nil { err = fmt . Errorf ( " " , err ) return } for _ , file := range upload . Files { uuid := sb . getFileID ( file . UploadID , file . ID ) err = sb . client . Bucket ( sb . Config . Bucket ) . Object ( uuid ) . Delete ( context . Background ( ) ) if err != nil { if err == storage . ErrObjectNotExist { err = nil } else { return fmt . Errorf ( " " , uuid , err ) } } } return }
RemoveUpload implementation for Google Cloud Storage Data Backend
Iterates on each upload file and call RemoveFile
RemoveUpload implementation for Google Cloud Storage Data Backend Iterates on each upload file and call RemoveFile
// Get the GCS client // Remove all files