{"id":13609956,"url":"https://github.com/web3-storage/go-w3s-client","last_synced_at":"2025-04-12T22:32:12.917Z","repository":{"id":38353158,"uuid":"382904687","full_name":"web3-storage/go-w3s-client","owner":"web3-storage","description":"DEPRECATED ⁂ A client to the Web3.Storage API.","archived":true,"fork":false,"pushed_at":"2024-01-09T14:45:43.000Z","size":253,"stargazers_count":34,"open_issues_count":4,"forks_count":26,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-07T16:41:29.335Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web3-storage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-07-04T16:58:40.000Z","updated_at":"2024-04-18T16:23:33.000Z","dependencies_parsed_at":"2024-01-14T06:56:31.561Z","dependency_job_id":null,"html_url":"https://github.com/web3-storage/go-w3s-client","commit_stats":{"total_commits":31,"total_committers":6,"mean_commits":5.166666666666667,"dds":"0.19354838709677424","last_synced_commit":"737a86cd5d5e9a77d5eb3802232bac01812eb985"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3-storage%2Fgo-w3s-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3-storage%2Fgo-w3s-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3-storage%2Fgo-w3s-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3-storage%2Fgo-w3s-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3-storage","download_url":"https://codeload.github.com/web3-storage/go-w3s-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248640919,"owners_count":21138112,"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-08-01T19:01:39.705Z","updated_at":"2025-04-12T22:32:12.631Z","avatar_url":"https://github.com/web3-storage.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003e ⚠️ **DEPRECATED** This repo will be archived on January 9, 2024 as this web3.storage API will no longer take new uploads. Please use the [new client and API](https://github.com/web3-storage/go-w3up) for future usage of web3.storage. Documentation for the new client can be found [here](https://web3.storage/docs). You can learn more about these changes [here](https://blog.web3.storage/posts/the-data-layer-is-here-with-the-new-web3-storage).\n\n# go-w3s-client\n\nA client to the Web3.Storage API.\n\nDemo: https://youtu.be/FLsQZ_ogeOg\n\n## Install\n\n```sh\ngo get github.com/web3-storage/go-w3s-client\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"io/fs\"\n    \"os\"\n    \"github.com/web3-storage/go-w3s-client\"\n)\n\nfunc main() {\n    c, _ := w3s.NewClient(w3s.WithToken(\"\u003cAUTH_TOKEN\u003e\"))\n    f, _ := os.Open(\"images/pinpie.jpg\")\n\n    // OR add a whole directory:\n    //\n    //   f, _ := os.Open(\"images\")\n    //\n    // OR create your own directory:\n    //\n    //   img0, _ := os.Open(\"aliens.jpg\")\n    //   img1, _ := os.Open(\"donotresist.jpg\")\n    //   f := w3fs.NewDir(\"images\", []fs.File{img0, img1})\n\n    // Write a file/directory\n    cid, _ := c.Put(context.Background(), f)\n    fmt.Printf(\"https://%v.ipfs.dweb.link\\n\", cid)\n\n    // Retrieve a file/directory\n    res, _ := c.Get(context.Background(), cid)\n    \n    // res is a http.Response with an extra method for reading IPFS UnixFS files!\n    f, fsys, _ := res.Files()\n\n    // List directory entries\n    if d, ok := f.(fs.ReadDirFile); ok {\n        ents, _ := d.ReadDir(0)\n        for _, ent := range ents {\n            fmt.Println(ent.Name())\n        }\n    }\n\n    // Walk whole directory contents (including nested directories)\n    fs.WalkDir(fsys, \"/\", func(path string, d fs.DirEntry, err error) error {\n        info, _ := d.Info()\n        fmt.Printf(\"%s (%d bytes)\\n\", path, info.Size())\n        return err\n    })\n\n    // Open a file in a directory\n    img, _ := fsys.Open(\"pinpie.jpg\")\n    // img.Stat()\n    // img.Read(...)\n    // img.Close()\n}\n```\n\nSee [example](./example) for more.\n\n## API\n\n[pkg.go.dev Reference](https://pkg.go.dev/github.com/web3-storage/go-w3s-client)\n\n## Contribute\n\nFeel free to dive in! [Open an issue](https://github.com/web3-storage/go-w3s-client/issues/new) or submit PRs.\n\n## License\n\nDual-licensed under [MIT + Apache 2.0](https://github.com/web3-storage/go-w3s-client/blob/main/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3-storage%2Fgo-w3s-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3-storage%2Fgo-w3s-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3-storage%2Fgo-w3s-client/lists"}