{"id":18417592,"url":"https://github.com/xiaomi/go-fds","last_synced_at":"2026-02-04T09:18:05.485Z","repository":{"id":57508039,"uuid":"202269627","full_name":"XiaoMi/go-fds","owner":"XiaoMi","description":"Next-generation fds golang sdk","archived":false,"fork":false,"pushed_at":"2024-11-28T07:03:01.000Z","size":1151,"stargazers_count":21,"open_issues_count":0,"forks_count":12,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-22T18:41:28.111Z","etag":null,"topics":["fds","go","s3"],"latest_commit_sha":null,"homepage":"","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/XiaoMi.png","metadata":{"files":{"readme":"README-cn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-14T03:44:21.000Z","updated_at":"2024-12-24T08:14:02.000Z","dependencies_parsed_at":"2023-12-21T12:09:32.427Z","dependency_job_id":null,"html_url":"https://github.com/XiaoMi/go-fds","commit_stats":null,"previous_names":["apache9/go-fds","hujianxin/go-fds"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaoMi%2Fgo-fds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaoMi%2Fgo-fds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaoMi%2Fgo-fds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaoMi%2Fgo-fds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XiaoMi","download_url":"https://codeload.github.com/XiaoMi/go-fds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247653309,"owners_count":20973803,"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":["fds","go","s3"],"created_at":"2024-11-06T04:10:07.558Z","updated_at":"2026-02-04T09:18:05.433Z","avatar_url":"https://github.com/XiaoMi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-fds\n小米文件存储FDS(File Storage Service) Go SDK.\n\n# 简介\n因为接口已经固定，[旧SDK](https://github.com/XiaoMi/galaxy-fds-sdk-golang)已经不容易改动，但是存在一些问题，是重构无法解决的，比如：\n\n1. 内存不友好，旧SDK中，对object读写都是通过byte数组的形式，如果object较大，并且用户并发的写入，则会占用较大内存，并不能像Java SDK中使用InputStreamming那样友好。在Go语言中，提供了类似的机制，io.Reader io.Writer，这是输入输出的一种使用共识。\n2. 添加新的API较为困难，旧SDK每添加一个新的API都需要考虑过多的内在逻辑，写过多的冗余代码，新SDK则只需要几行代码就可以完成添加功能，大部分重复逻辑已经简化。\n3. 交互使用略显困难，比如在PutObject时，可以指定metadata或者Header，但是旧SDK这方面不易操作。新SDK通过反射的方式，解决了可选输入的问题。\n4. 接口、包命名不符规范，在Go语言中，有较为严格的命名规范，比如包命名必须是小写，函数命名不能带_，如果带了是勉强可以通过运行的，但是这不符合规范。\n\n另外，除了上面几个新SDK具有的优点之外，新版SDK参照S3和OSS的sdk设计，我也为这个SDK提供了并发的upload和download。\n\n最后，auth.go里面的signature方法是直接使用了旧SDK中的代码。\n\n## 安装\n`go get -u github.com/XiaoMi/go-fds`\n\n## 用法\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/XiaoMi/go-fds/fds\"\n\t\"github.com/XiaoMi/go-fds/fds/manager\"\n)\n\nfunc main() {\n\tconf, _ := fds.NewClientConfiguration(os.Getenv(\"GO_FDS_TEST_ENDPOINT\"))\n\tclient := fds.New(os.Getenv(\"GO_FDS_TEST_ACCESS_KEY_ID\"), os.Getenv(\"GO_FDS_TEST_ACCESS_KEY_SECRET\"), conf)\n\n\tdownloader := manager.NewDownloader(client, 1024*1024, 10, true)\n\n\trequest := \u0026manager.DownloadRequest{\n\t\tGetObjectRequest: fds.GetObjectRequest{\n\t\t\tBucketName: \"hellodf\",\n\t\t\tObjectName: \"build.log\",\n\t\t},\n\t\tFilePath: \"/home/XiaoMi/tmp/build.log\",\n\t}\n\terr := downloader.Download(request)\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t} else {\n\t\tlog.Println(\"Done\")\n\t}\n}\n```\n\n## License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaomi%2Fgo-fds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaomi%2Fgo-fds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaomi%2Fgo-fds/lists"}