基于Go实现的一个简单的文件服务器,只是简单的一个将多服务器中分散存储的文件集中管理,以方便多负载环境下使用。前期暂不支持:集群、自动复制与同步、冗余存储等
Port:端口 默认为 19860
User:用户名 Pwd:密码
Path:{名称:目录路径} 默认为{"Defaut":"./attachments" } AllowedIP: 英文分号分隔的IP白名单, 默认不限制IP
the protocol follow to redis protocol :
- For Simple Strings the first byte of the reply is "+"
- For Errors the first byte of the reply is "-"
- For Integers the first byte of the reply is ":"
- For Bulk Strings the first byte of the reply is "$" + bytes Count
- For Array the first byte of the reply is "*" + elements count
- [ext] For Bytes the first byte of the replay is "!" + byte array count
身份验证 timestamp: unix time string
切换目录 默认为Default=attachemnts
重新加载配置
文件是否在该服务器上存在
C: $6\r\nEXISTS\r\n
C: $12\r\nfileFullName\r\n
S: :0
返回文件长度,如果文件不存在返回-1
获取文件
返回文件的字节流
获取文件的一部分
返回:[文件原始长度][开始位置][实际长度][文件内容]
保存文件
成功返回 OK,否则返回错误原因
删除文件
成功返回 OK,否则返回错误原因
C: $4\r\nPING\r\n
S: +PONG
测试文件是否存在或所在的服务器
???
返回对应目录下的所有文件和目录, 目录以/结束
??? 连接两个或多个文件服务