{"id":19621666,"url":"https://github.com/pkg6/go-flysystem","last_synced_at":"2025-02-26T19:16:10.814Z","repository":{"id":176679335,"uuid":"618706927","full_name":"pkg6/go-flysystem","owner":"pkg6","description":"Perform archiving operations and migrate addresses","archived":false,"fork":false,"pushed_at":"2024-03-15T03:33:02.000Z","size":162,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-09T11:41:22.928Z","etag":null,"topics":[],"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/pkg6.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":"2023-03-25T05:29:14.000Z","updated_at":"2024-03-11T15:53:38.000Z","dependencies_parsed_at":"2023-10-02T08:12:34.893Z","dependency_job_id":"6efe85a0-85c9-4e4a-923e-20a72345fa29","html_url":"https://github.com/pkg6/go-flysystem","commit_stats":null,"previous_names":["pkg6/go-flysystem"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg6%2Fgo-flysystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg6%2Fgo-flysystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg6%2Fgo-flysystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkg6%2Fgo-flysystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkg6","download_url":"https://codeload.github.com/pkg6/go-flysystem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240917723,"owners_count":19878308,"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-11T11:23:56.004Z","updated_at":"2025-02-26T19:16:10.797Z","avatar_url":"https://github.com/pkg6.png","language":"Go","readme":"# go-flysystem\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/pkg6/go-flysystem)](https://goreportcard.com/report/github.com/pkg6/go-flysystem)\n[![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-blue?logo=go\u0026logoColor=white)](https://pkg.go.dev/github.com/pkg6/go-flysystem?tab=doc)\n[![Sourcegraph](https://sourcegraph.com/github.com/pkg6/go-flysystem/-/badge.svg)](https://sourcegraph.com/github.com/pkg6/go-flysystem?badge)\n[![Release](https://img.shields.io/github/release/pkg6/go-flysystem.svg?style=flat-square)](https://github.com/pkg6/go-flysystem/releases)\n[![Goproxy.cn](https://goproxy.cn/stats/github.com/pkg6/go-flysystem/badges/download-count.svg)](https://goproxy.cn)\n\n\n## About Flysystem\n\nFlysystem is a file storage library for Golang. It provides one interface to interact with many types of filesystems. When you use Flysystem, you're not only protected from vendor lock-in, you'll also have a consistent experience for which ever storage is right for you.\n\n## Install\n\n~~~\n$ go get github.com/pkg6/go-flysystem\n~~~\n\n## example\n\n~~~\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/pkg6/go-flysystem\"\n\t\"github.com/pkg6/go-flysystem/local\"\n\t\"strings\"\n)\n\nfunc main() {\n\t//Define the root directory of the local adapter\n\troot := \"./_example/test_data\"\n\t// Create local adapter\n\tlocalAdapter := local.New(\u0026local.Config{Root: root})\n\t//Initialize the adapter\n\tadapters := flysystem.NewAdapters(localAdapter)\n\tadapters.Extend(local.New(\u0026local.Config{Root: \"./_example/test_data/2\"}), \"local2\")\n\tvar err error\n\t_, err = adapters.WriteReader(\"4.txt\", strings.NewReader(\"test\"))\n\tfmt.Println(err)\n\tadapter, err := adapters.Adapter(\"local2\")\n\t_, err = adapter.WriteReader(\"4.txt\", strings.NewReader(\"test\"))\n\tfmt.Println(err)\n\t//Write file\n\t_, err = adapters.Write(\"1.txt\", []byte(\"test data\"))\n\tfmt.Println(err)\n\t//Write data from resource file\n\t_, err = adapters.WriteStream(\"2.txt\", root+\"/1.txt\")\n\tfmt.Println(err)\n\t//Update file\n\t_, err = adapters.Update(\"1.txt\", []byte(\"test update data\"))\n\tfmt.Println(err)\n\t//Update data from resource file\n\t_, err = adapters.UpdateStream(\"2.txt\", root+\"/1.txt\")\n\tfmt.Println(err)\n\texists, _ := adapters.Exists(\"2.txt\")\n\tfmt.Println(exists)\n\t//Read file\n\tread, err := adapters.Read(\"2.txt\")\n\tfmt.Println(read, err)\n\t//Get file mime type\n\tmimeType, err := adapters.MimeType(\"2.txt\")\n\tfmt.Println(mimeType, err)\n\t//Get file size\n\tsize, err := adapters.Size(\"2.txt\")\n\tfmt.Println(size, err)\n\t//Move file\n\t_, err = adapters.Move(\"1.txt\", \"4.txt\")\n\tfmt.Println(err)\n\t//Copy file\n\t_, err = adapters.Copy(\"2.txt\", \"5.txt\")\n\tfmt.Println(err)\n}\n~~~\n\n## Associated Projects\n\ngfs： [github.com/pkg6/gfs](https://github.com/pkg6/gfs)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg6%2Fgo-flysystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkg6%2Fgo-flysystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkg6%2Fgo-flysystem/lists"}