{"id":18886746,"url":"https://github.com/supabase-community/storage-go","last_synced_at":"2025-04-13T10:34:18.114Z","repository":{"id":41196726,"uuid":"438393541","full_name":"supabase-community/storage-go","owner":"supabase-community","description":"Storage util client for Supabase in Go","archived":false,"fork":false,"pushed_at":"2024-07-08T06:30:15.000Z","size":38,"stargazers_count":55,"open_issues_count":9,"forks_count":31,"subscribers_count":8,"default_branch":"dev","last_synced_at":"2025-04-06T17:22:04.261Z","etag":null,"topics":["hacktoberfest","storage","supabase"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/supabase-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-14T20:40:06.000Z","updated_at":"2025-04-04T04:42:29.000Z","dependencies_parsed_at":"2024-01-03T01:14:19.115Z","dependency_job_id":"faa272f3-2ab0-4e10-9e12-aa4a81036869","html_url":"https://github.com/supabase-community/storage-go","commit_stats":{"total_commits":32,"total_committers":7,"mean_commits":4.571428571428571,"dds":0.625,"last_synced_commit":"c1cfc22761ef3fc8750546af6f5eb0d688358c53"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase-community%2Fstorage-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase-community%2Fstorage-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase-community%2Fstorage-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supabase-community%2Fstorage-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supabase-community","download_url":"https://codeload.github.com/supabase-community/storage-go/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328405,"owners_count":21085314,"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":["hacktoberfest","storage","supabase"],"created_at":"2024-11-08T07:30:28.140Z","updated_at":"2025-04-13T10:34:18.058Z","avatar_url":"https://github.com/supabase-community.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Storage GO\n\nThis library is a Golang client for the [Supabase Storage API](https://supabase.com/docs/guides/storage). It's a collection of helper functions that help you manage your buckets through the API.\n\n## Quick start guide\n\n#### Install\n\n```shell\ngo get github.com/supabase-community/storage-go\n```\n\n### Connecting to the storage backend\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\tstorage_go \"github.com/supabase-community/storage-go\"\n)\n\nfunc main() {\n\tstorageClient := storage_go.NewClient(\"https://\u003cproject-reference-id\u003e.supabase.co/storage/v1\", \"\u003cproject-secret-api-key\u003e\", nil)\n}\n```\n\n### Handling resources\n\n#### Handling Storage Buckets\n\n- Create a new Storage bucket:\n\n```go\n  result, err := storageClient.CreateBucket(\"bucket-id\", storage_go.BucketOptions{\n    Public: true,\n  })\n```\n\n- Retrieve the details of an existing Storage bucket:\n\n```go\n  result, err := storageClient.GetBucket(\"bucket-id\")\n```\n\n- Update a new Storage bucket:\n\n```go\n  result, err := storageClient.UpdateBucket(\"bucket-id\", storage_go.BucketOptions{\n    Public: true,\n  })\n```\n\n- Remove all objects inside a single bucket:\n\n```go\n  result, err := storageClient.EmptyBucket(\"bucket-id\")\n```\n\n- Delete an existing bucket (a bucket can't be deleted with existing objects inside it):\n\n```go\n  result, err := storageClient.DeleteBucket(\"bucket-id\")\n```\n\n- Retrieve the details of all Storage buckets within an existing project:\n\n```go\n  result, err := storageClient.ListBuckets(\"bucket-id\")\n```\n\n#### Handling Files\n\n```go\n  fileBody := ... // load your file here\n\n  result, err := storageClient.UploadFile(\"test\", \"test.txt\", fileBody)\n```\n\n\u003e Note: The `upload` method also accepts a map of optional parameters.\n\n- Download a file from an exisiting bucket:\n\n```go\n  result, err := storageClient.DownloadFile(\"bucket-id\", \"test.txt\")\n```\n\n- List all the files within a bucket:\n\n```go\n  result, err := storageClient.ListFiles(\"bucket-id\", \"\", storage_go.FileSearchOptions{\n      Limit:  10,\n      Offset: 0,\n      SortByOptions: storage_go.SortBy{\n      Column: \"\",\n      Order:  \"\",\n    },\n  })\n```\n\n\u003e Note: The `list` method also accepts a map of optional parameters.\n\n- Replace an existing file at the specified path with a new one:\n\n```go\n  fileBody := ... // load your file here\n\n  result, err := storageClient.UpdateFile(\"test\", \"test.txt\", file)\n```\n\n- Move an existing file:\n\n```go\n  result, err := storageClient.MoveFile(\"test\", \"test.txt\", \"random/test.txt\")\n```\n\n- Delete files within the same bucket:\n\n```go\n  result, err := storageClient.RemoveFile(\"test\", []string{\"book.pdf\"})\n```\n\n- Create signed URL to download file without requiring permissions:\n\n```go\n  const expireIn = 60\n\n  result, err := storageClient.CreateSignedUrl(\"test\", \"test.mp4\", expireIn)\n```\n\n- Retrieve URLs for assets in public buckets:\n\n```go\n  result, err := storageClient.GetPublicUrl(\"test\", \"book.pdf\")\n```\n\n- Create an signed URL and upload to signed URL:\n\n```go\n  fileBody := ... // load your file here\n\n  resp, err := storageClient.CreateSignedUploadUrl(\"test\", \"test.txt\")\n  res, err := storageClient.UploadToSignedUrl(resp.Url, file)\n```\n\n## License\n\n\u003c!-- I don't know which to use, but explicitly stating the license would be a big help --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase-community%2Fstorage-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupabase-community%2Fstorage-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupabase-community%2Fstorage-go/lists"}