Constructors
constructor
- new Gfs(c, gid): Gfs
Returns Gfs
Properties
Accessors
group_id
- get group_id(): number
Returns number
Methods
df
- df(): Promise<{
free: number;
total: number;
used: number;
} & {
file_count: number;
max_file_count: number;
}> Returns Promise<{
free: number;
total: number;
used: number;
} & {
file_count: number;
max_file_count: number;
}>
dir
- dir(pid?, start?, limit?): Promise<(GfsFileStat | GfsDirStat)[]>
Parameters
- pid: string = "/"
- start: number = 0
- limit: number = 100
文件和目录列表
download
- download(fid): Promise<Omit<FileElem, "type"> & {
url: string;
}> Returns Promise<Omit<FileElem, "type"> & {
url: string;
}>
forward
- forward(stat, pid?, name?): Promise<GfsFileStat>
转发的文件在当前群的属性
forwardOfflineFile
- forwardOfflineFile(fid, name?): Promise<GfsFileStat>
Parameters
- fid: string
Optional
name: string
转发的文件在当前群的属性
ls
- ls(pid?, start?, limit?): Promise<(GfsFileStat | GfsDirStat)[]>
Parameters
- pid: string = "/"
- start: number = 0
- limit: number = 100
mv
- mv(fid, pid): Promise<void>
Returns Promise<void>
rename
- rename(fid, name): Promise<void>
Returns Promise<void>
rm
- rm(fid): Promise<void>
Returns Promise<void>
upload
- upload(file, pid?, name?, callback?): Promise<GfsFileStat>
Parameters
- file: string | Buffer | Uint8Array
- pid: string = "/"
Optional
name: stringOptional
callback: ((percentage: string) => void)- (percentage): void
Returns void
上传的文件属性
群文件系统
fid
表示一个文件或目录的id,pid
表示它所在目录的id 根目录的id为"/" 只能在根目录下创建目录 删除一个目录会删除下面的全部文件