# 文件服务器 **Repository Path**: noobjiang/my-file-http-server ## Basic Information - **Project Name**: 文件服务器 - **Description**: go实现的文件服务器 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-10-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 文件服务器 go实现的文件服务器。 包结构: * config:初始化配置 * cache:进程级缓存 * handler:接入层 * initinfo:初始化 test;测试 功能代码: * 列举文件:http://localhost:8080/files 前端可以请求之后将xml解析获取文件列表 然后填充到html中局部刷新,也可以在server段用go的file包列举 * 上传html: handler/upload.go * 上传go:upload_test.go TestUpload 先获取token http://ip:port/getToken 然后调用测试方法 * token : token/token.go (具体生成token) handler/upload.go (http入口,创建token->上传->校验token并删除) cache/tokenmap.go (初始化token的缓存,300s清理一次过期token) * 上传测试 upload.gptl,先获取token再上传文件