# filedb **Repository Path**: powersky/filedb ## Basic Information - **Project Name**: filedb - **Description**: golang文件存储服务 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-10-30 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # filedb #### 介绍 golang文件存储服务 - [x] 支持文件上传、下载 - [x] 图片裁剪 - [x] 图片缩放 - [x] 删除 #### 安装教程 在Release页面下载二进制文件运行 ``` filedb --path config.json ``` #### 使用说明 - 获取文件/图像 URL为 **GET** `/filedb/files?fileId=xxx&width=100&height=100&mode=1` - 当目标对象是图像时,mode为1,那么会按照指定宽度和高度进行缩略 - 当目标对象是图像时,mode为2,那么会按照指定宽度和高度进行裁剪 - 当目标不是图像时,任何mode值都将无效 - 当目标无论是否为图像,如果mode为0,返回格式为二进制文件数据 - 上传图像 URL为 **POST** `/filedb/files` - 需要上传Formdate数据,上传多个文件也会从中只取一个,FromeData数据文件对应的key值必须是 `file`。 - 返回结果为 ``` { successful: true, desc: "", data: null } ``` - 获取数据库存储信息 URL为 **GET** `/filedb/diskInfo` - 返回格式为 ``` { successful: true, desc: "", data: { free: 100, available: 100, cap: 1000, used: 40, usage: 0.56 } } ``` - 删除文件 URL为 **DELETE** `/filedb/files/1234fda1313` - 返回格式为 ``` { successful: true, desc: "", data: null } ``` #### 参与贡献