mirror of
https://github.com/certd/certd.git
synced 2026-04-15 05:00:52 +08:00
chore:
This commit is contained in:
25
packages/plugins/plugin-lib/src/oss/alioss.ts
Normal file
25
packages/plugins/plugin-lib/src/oss/alioss.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { AliyunAccess } from "../aliyun";
|
||||
import { HttpClient, ILogger } from "@certd/basic";
|
||||
import { IOssClient, OssClientDeleteReq } from "./api";
|
||||
|
||||
export class AliossClient implements IOssClient {
|
||||
access: AliyunAccess;
|
||||
logger: ILogger;
|
||||
http: HttpClient;
|
||||
|
||||
constructor(opts: { access: AliyunAccess; http: HttpClient; logger: ILogger }) {
|
||||
this.access = opts.access;
|
||||
this.http = opts.http;
|
||||
this.logger = opts.logger;
|
||||
}
|
||||
|
||||
upload(key: string, content: Buffer | string): Promise<void> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
download(key: string, savePath?: string): Promise<void> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
delete(opts: OssClientDeleteReq): Promise<void> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
}
|
||||
12
packages/plugins/plugin-lib/src/oss/api.ts
Normal file
12
packages/plugins/plugin-lib/src/oss/api.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export type OssClientDeleteReq = {
|
||||
key: string;
|
||||
beforeDays?: number;
|
||||
};
|
||||
|
||||
export interface IOssClient {
|
||||
upload(key: string, content: Buffer | string): Promise<void>;
|
||||
|
||||
download(key: string, savePath?: string): Promise<void>;
|
||||
|
||||
delete(opts: OssClientDeleteReq): Promise<void>;
|
||||
}
|
||||
Reference in New Issue
Block a user