{"id":16464524,"url":"https://github.com/deatil/go-filesystem","last_synced_at":"2025-07-26T03:12:19.949Z","repository":{"id":57653737,"uuid":"412010551","full_name":"deatil/go-filesystem","owner":"deatil","description":"go 版本文件管理器 / filesystem for golang","archived":false,"fork":false,"pushed_at":"2024-12-23T05:47:08.000Z","size":58,"stargazers_count":17,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T14:51:12.478Z","etag":null,"topics":["filesystem","go","go-filesystem","webdav"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/deatil/go-filesystem","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/deatil.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-30T09:55:44.000Z","updated_at":"2024-12-23T05:33:09.000Z","dependencies_parsed_at":"2024-06-19T05:23:31.417Z","dependency_job_id":"c6447774-735d-4438-be57-74b96f11b9eb","html_url":"https://github.com/deatil/go-filesystem","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/deatil/go-filesystem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-filesystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-filesystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-filesystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-filesystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deatil","download_url":"https://codeload.github.com/deatil/go-filesystem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-filesystem/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267110052,"owners_count":24037634,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["filesystem","go","go-filesystem","webdav"],"created_at":"2024-10-11T11:28:30.084Z","updated_at":"2025-07-26T03:12:19.926Z","avatar_url":"https://github.com/deatil.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 文件管理器\n\n\n### 项目介绍\n\n*  go 版本实现的文件管理器\n\n\n### 适配器\n\n*  `local`: 本地存储\n\n\n### 下载安装\n\n~~~go\ngo get -u github.com/deatil/go-filesystem\n~~~\n\n\n### 示例\n\n~~~go\nimport (\n    \"fmt\"\n\n    \"github.com/deatil/go-filesystem/filesystem\"\n    local_adapter \"github.com/deatil/go-filesystem/filesystem/adapter/local\"\n)\n\nfunc main() {\n    // 根目录\n    root := \"/storage\"\n    adapter := local_adapter.New(root)\n\n    // 磁盘\n    fs := filesystem.New(adapter)\n\n    // 写入数据\n    path := \"/path.txt\"\n    contents := []byte(\"testdata\")\n\n    ok, err := fs.Write(path, contents)\n    if err != nil {\n        fmt.Println(err.Error())\n    }\n}\n~~~\n\n\n### 常用方法\n\n~~~go\n// 写入\nWrite(path, contents []byte) (bool, error)\n\n// 写入数据流\nWriteStream(path string, resource io.Reader) (bool, error)\n\n// 添加数据\nPut(path, contents []byte) (bool, error)\n\n// 添加数据流\nPutStream(path string, resource io.Reader) (bool, error)\n\n// 读取后删除\nReadAndDelete(path string) (any, error)\n\n// 更新\nUpdate(path, contents []byte) (bool, error)\n\n// 读取\nRead(path string) ([]byte, error)\n\n// 重命名\nRename(path, newpath string) (bool, error)\n\n// 复制\nCopy(path, newpath string) (bool, error)\n\n// 删除\nDelete(path string) (bool, error)\n\n// 删除文件夹\nDeleteDir(dirname string) (bool, error)\n\n// 创建文件夹\nCreateDir(dirname string) (bool, error)\n\n// 列出内容\nListContents(dirname string) ([]map[string]any, error)\n~~~\n\n\n### 开源协议\n\n*  `go-filesystem` 遵循 `Apache2` 开源协议发布，在保留本软件版权的情况下提供个人及商业免费使用。\n\n\n### 版权\n\n*  该系统所属版权归 deatil(https://github.com/deatil) 所有。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fgo-filesystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeatil%2Fgo-filesystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fgo-filesystem/lists"}