{"id":13983616,"url":"https://github.com/jhchabran/gistfs","last_synced_at":"2025-10-10T12:15:17.148Z","repository":{"id":55074359,"uuid":"326222098","full_name":"jhchabran/gistfs","owner":"jhchabran","description":"A Go io/fs filesystem implementation for reading files in Github gists. ","archived":false,"fork":false,"pushed_at":"2021-09-17T16:45:51.000Z","size":22,"stargazers_count":127,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-10T12:15:16.339Z","etag":null,"topics":["golang"],"latest_commit_sha":null,"homepage":"","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/jhchabran.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}},"created_at":"2021-01-02T16:22:37.000Z","updated_at":"2025-08-27T13:21:50.000Z","dependencies_parsed_at":"2022-08-14T11:10:44.927Z","dependency_job_id":null,"html_url":"https://github.com/jhchabran/gistfs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jhchabran/gistfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhchabran%2Fgistfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhchabran%2Fgistfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhchabran%2Fgistfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhchabran%2Fgistfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhchabran","download_url":"https://codeload.github.com/jhchabran/gistfs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhchabran%2Fgistfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003898,"owners_count":26083639,"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-10-10T02:00:06.843Z","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":["golang"],"created_at":"2024-08-09T05:01:49.815Z","updated_at":"2025-10-10T12:15:17.130Z","avatar_url":"https://github.com/jhchabran.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# GistFS\n\nGistFS is an `io/fs` implementation that enables to read files stored in a given Gist.\n\n## Requirements\n\nThis module depends on `io/fs` which is only available since [go 1.16](https://tip.golang.org/doc/go1.16).\n\n## Usage\n\nGistFS is threadsafe.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/jhchabran/gistfs\"\n)\n\nfunc main() {\n\t// create a FS based on https://gist.github.com/jhchabran/ded2f6727d98e6b0095e62a7813aa7cf\n\tgfs := gistfs.New(\"ded2f6727d98e6b0095e62a7813aa7cf\")\n\n\t// load the remote content once for all,\n\t// ie, no more API calls toward Github will be made.\n\terr := gfs.Load(context.Background())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// --- base API\n\t// open the \"test1.txt\" file\n\tf, err := gfs.Open(\"test1.txt\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// read its content\n\tb := make([]byte, 1024)\n\t_, err = f.Read(b)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(string(b))\n\n\t// --- ReadFile API\n\t// directly read the \"test1.txt\" file\n\tb, err = gfs.ReadFile(\"test1.txt\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(string(b))\n\n\t// --- ReadDir API\n\t// there is only one directory in a gistfile, the root dir \".\"\n\tfiles, err := gfs.ReadDir(\".\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, entry := range files {\n\t\tfmt.Println(entry.Name())\n\t}\n\n\t// --- Serve the files from the gists over http\n\thttp.ListenAndServe(\":8080\", http.FileServer(http.FS(gfs)))\n}\n```\n\n## See also\n\n- [io/fs godoc](https://pkg.go.dev/io/fs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhchabran%2Fgistfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhchabran%2Fgistfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhchabran%2Fgistfs/lists"}