{"id":19966661,"url":"https://github.com/truthhun/cloudstore","last_synced_at":"2025-06-14T15:05:35.620Z","repository":{"id":49363864,"uuid":"176543694","full_name":"TruthHun/CloudStore","owner":"TruthHun","description":"国内各大云存储服务接口集成，让云存储使用更方便简单","archived":false,"fork":false,"pushed_at":"2021-04-08T07:05:37.000Z","size":7678,"stargazers_count":112,"open_issues_count":1,"forks_count":60,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-14T15:05:35.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TruthHun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-19T15:30:18.000Z","updated_at":"2025-01-20T15:26:35.000Z","dependencies_parsed_at":"2022-09-07T14:01:13.143Z","dependency_job_id":null,"html_url":"https://github.com/TruthHun/CloudStore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TruthHun/CloudStore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TruthHun%2FCloudStore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TruthHun%2FCloudStore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TruthHun%2FCloudStore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TruthHun%2FCloudStore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TruthHun","download_url":"https://codeload.github.com/TruthHun/CloudStore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TruthHun%2FCloudStore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259835393,"owners_count":22918980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T02:37:30.604Z","updated_at":"2025-06-14T15:05:35.602Z","avatar_url":"https://github.com/TruthHun.png","language":"Go","readme":"# CloudStore - 云储存集成\r\n\r\n国内各大云存储服务接口集成，让云存储使用更方便简单。\r\n\r\n目前集成的有：`阿里云OSS`,`百度云BOS`、`腾讯云COS`、`华为云OBS`、`七牛云`、`又拍云`、[Minio](https://www.bookstack.cn/books/MinioCookbookZH)\r\n\r\n## 为什么要有这个项目？\r\n\r\n为了一劳永逸...\r\n\r\n为了变得更懒...\r\n\r\n如果上传文件到各大云存储，都变成下面这样:\r\n```\r\nclientBOS.Upload(tmpFile, saveFile)     // 百度云\r\nclientCOS.Upload(tmpFile, saveFile)     // 腾讯云\r\nclientMinio.Upload(tmpFile, saveFile)   // Minio\r\nclientOBS.Upload(tmpFile, saveFile)     // 华为云\r\nclientOSS.Upload(tmpFile, saveFile)     // 阿里云\r\nclientUpYun.Upload(tmpFile, saveFile)   // 又拍云\r\nclientQiniu.Upload(tmpFile, saveFile)   // 七牛云\r\n```\r\n\r\n如果各大云存储删除文件对象，都变成下面这样：\r\n```\r\nclientXXX.Delete(file1, file2, file3, ...)\r\n```\r\n\r\n不需要翻看各大云存储服务的一大堆文档，除了创建的客户端对象不一样之外，调用的方法和参数都一毛一样，会不会很爽？\r\n\r\n\r\n\r\n## 目前初步实现的功能接口\r\n\r\n```\r\ntype CloudStore interface {\r\n\tDelete(objects ...string) (err error)                                             // 删除文件\r\n\tGetSignURL(object string, expire int64) (link string, err error)                  // 文件访问签名\r\n\tIsExist(object string) (err error)                                                // 判断文件是否存在\r\n\tLists(prefix string) (files []File, err error)                                    // 文件前缀，列出文件\r\n\tUpload(tmpFile string, saveFile string, headers ...map[string]string) (err error) // 上传文件\r\n\tDownload(object string, savePath string) (err error)                              // 下载文件\r\n\tGetInfo(object string) (info File, err error)                                     // 获取指定文件信息\r\n}\r\n```\r\n\r\n\r\n## 目前集成和实现的功能\r\n\r\n- [x] oss - 阿里云云存储 [SDK](https://github.com/aliyun/aliyun-oss-go-sdk) \u0026\u0026 [文档](https://www.bookstack.cn/books/aliyun-oss-go-sdk)\r\n- [x] cos - 腾讯云云存储 [SDK](https://github.com/tencentyun/cos-go-sdk-v5) \u0026\u0026 [文档](https://www.bookstack.cn/books/tencent-cos-go-sdk)\r\n- [x] bos - 百度云云存储 [SDK](https://github.com/baidubce/bce-sdk-go) \u0026\u0026 [文档](https://www.bookstack.cn/books/bos-go-sdk)\r\n- [x] qiniu - 七牛云存储 [SDK](https://github.com/qiniu/api.v7) \u0026\u0026 [文档](https://www.bookstack.cn/books/qiniu-go-sdk)\r\n- [x] upyun - 又拍云存储 [SDK](https://github.com/upyun/go-sdk) \u0026\u0026 [文档]()\r\n- [x] obs - 华为云云存储 [SDK](https://support.huaweicloud.com/devg-obs_go_sdk_doc_zh/zh-cn_topic_0142815182.html) \u0026\u0026 [文档](https://www.bookstack.cn/books/obs-go-sdk)\r\n- [x] minio [SDK](https://github.com/minio/minio-go) \u0026\u0026 [文档](https://www.bookstack.cn/books/MinioCookbookZH)\r\n\r\n\r\n\r\n\r\nTODO: \r\n- [x] 注意，domain 参数要处理一下，最后统一不带\"/\"\r\n- [x] 最后获取的签名链接，替换成绑定的域名\r\n- [x] timeout 时间要处理一下，因为一些非内网方式上传文件，在大文件的时候，5分钟或者10分钟都有可能会超时\r\n- [x] `Lists`方法在查询列表的时候，需要对prefix参数做下处理\r\n\r\n## 注意\r\n所有云存储的`endpoint`，在配置的时候都是不带 `http://`或者`https://`的\r\n\r\n## DocHub 可用云存储\r\n- [x] 百度云 BOS，需要自行压缩svg文件为gzip\r\n- [x] 腾讯云 COS，需要自行压缩svg文件为gzip\r\n- [x] 阿里云 OSS，需要自行压缩svg文件为gzip\r\n- [x] Minio，需要自行压缩svg文件为gzip\r\n- [x] 七牛云存储，在上传svg的时候不需要压缩，svg访问的时候，云存储自行压缩了\r\n- [x] 又拍云，在上传svg的时候不需要压缩，svg访问的时候，云存储自行压缩了\r\n- [x] 华为云 OBS，在上传svg的时候不需要压缩，svg访问的时候，云存储自行压缩了\r\n\r\n\r\n\r\n\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruthhun%2Fcloudstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruthhun%2Fcloudstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruthhun%2Fcloudstore/lists"}