Expand kv api
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { MinioService } from './minio.service';
|
||||
|
||||
describe('MinioService', () => {
|
||||
let service: MinioService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [MinioService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<MinioService>(MinioService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
@@ -88,4 +88,19 @@ export class MinioService {
|
||||
): Promise<void> {
|
||||
await this.client.removeObject(bucketName, objectName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param bucketName
|
||||
* @param objectName
|
||||
* @param expiry Expiry in seconds
|
||||
* @returns
|
||||
*/
|
||||
public async generatePresignedUrl(
|
||||
bucketName: string,
|
||||
objectName: string,
|
||||
expiry: number = 60 * 60 * 24,
|
||||
): Promise<string> {
|
||||
return await this.client.presignedGetObject(bucketName, objectName, expiry);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user