{"id":24995973,"url":"https://github.com/fclairamb/afero-s3","last_synced_at":"2025-04-05T04:11:12.725Z","repository":{"id":37067842,"uuid":"264543108","full_name":"fclairamb/afero-s3","owner":"fclairamb","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-15T22:15:14.000Z","size":649,"stargazers_count":51,"open_issues_count":15,"forks_count":23,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T03:07:03.139Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fclairamb.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":"2020-05-16T22:58:23.000Z","updated_at":"2025-03-28T22:08:51.000Z","dependencies_parsed_at":"2023-10-13T12:30:30.089Z","dependency_job_id":"f73dd990-6a49-425a-9510-8194078c4ddb","html_url":"https://github.com/fclairamb/afero-s3","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fclairamb%2Fafero-s3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fclairamb%2Fafero-s3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fclairamb%2Fafero-s3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fclairamb%2Fafero-s3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fclairamb","download_url":"https://codeload.github.com/fclairamb/afero-s3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284949,"owners_count":20913704,"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":"2025-02-04T15:53:07.316Z","updated_at":"2025-04-05T04:11:12.705Z","avatar_url":"https://github.com/fclairamb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# S3 Backend for Afero\n\n![Build](https://github.com/fclairamb/afero-s3/workflows/Build/badge.svg)\n[![codecov](https://codecov.io/gh/fclairamb/afero-s3/branch/main/graph/badge.svg?token=OZ2WZ969O5)](https://codecov.io/gh/fclairamb/afero-s3)\n[![Go Report Card](https://goreportcard.com/badge/fclairamb/afero-s3)](https://goreportcard.com/report/fclairamb/afero-s3)\n[![GoDoc](https://godoc.org/github.com/fclairamb/afero-s3?status.svg)](https://godoc.org/github.com/fclairamb/afero-s3)\n\n\n## About\nIt provides an [afero filesystem](https://github.com/spf13/afero/) implementation of an [S3](https://aws.amazon.com/s3/) backend.\n\nThis was created to provide a backend to the [ftpserver](https://github.com/fclairamb/ftpserver) but can definitely be used in any other code.\n\nI'm very opened to any improvement through issues or pull-request that might lead to a better implementation or even\nbetter testing.\n\n## Key points\n- Download \u0026 upload file streaming\n- 75% coverage (all APIs are tested, but not all errors are reproduced)\n- Very carefully linted\n\n## Known limitations\n- File appending / seeking for write is not supported because S3 doesn't support it, it could be simulated by rewriting entire files.\n- Chtimes is not supported because S3 doesn't support it, it could be simulated through metadata.\n- Chmod support is very limited\n\n\n## How to use\nNote: Errors handling is skipped for brevity but you definitely have to handle it.\n```golang\n\nimport(\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/session\"\n  \n\ts3 \"github.com/fclairamb/afero-s3\"\n)\n\nfunc main() {\n  // You create a session\n  sess, _ := session.NewSession(\u0026aws.Config{\n    Region:      aws.String(region),\n    Credentials: credentials.NewStaticCredentials(keyID, secretAccessKey, \"\"),\n  })\n\n  // Initialize the file system\n  s3Fs := s3.NewFs(bucket, sess)\n\n  // And do your thing\n  file, _ := fs.OpenFile(\"file.txt\", os.O_WRONLY, 0777)\n  file.WriteString(\"Hello world !\")\n  file.Close()\n}\n```\n\n## Thanks\n\nThe initial code (which was massively rewritten) comes from:\n- [wreulicke's fork](https://github.com/wreulicke/afero-s3)\n- Itself forked from [aviau's fork](https://github.com/aviau/).\n- Initially proposed as [an afero PR](https://github.com/spf13/afero/pull/90) by [rgarcia](https://github.com/rgarcia) and updated by [aviau](https://github.com/aviau).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffclairamb%2Fafero-s3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffclairamb%2Fafero-s3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffclairamb%2Fafero-s3/lists"}