{"id":21286247,"url":"https://github.com/moriyoshi/simplefiletx","last_synced_at":"2025-08-09T14:14:44.596Z","repository":{"id":66468347,"uuid":"135139809","full_name":"moriyoshi/simplefiletx","owner":"moriyoshi","description":"A (non-hurting) file protocol handler implementation for Go's net.http.","archived":false,"fork":false,"pushed_at":"2019-02-02T05:17:35.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-07T02:49:08.031Z","etag":null,"topics":["file","golang","http","transport","url"],"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/moriyoshi.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":"2018-05-28T09:28:48.000Z","updated_at":"2019-07-11T08:08:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"017481fa-105b-4eb8-8a2d-27c1f473b643","html_url":"https://github.com/moriyoshi/simplefiletx","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moriyoshi%2Fsimplefiletx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moriyoshi%2Fsimplefiletx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moriyoshi%2Fsimplefiletx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moriyoshi%2Fsimplefiletx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moriyoshi","download_url":"https://codeload.github.com/moriyoshi/simplefiletx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243746238,"owners_count":20341204,"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":["file","golang","http","transport","url"],"created_at":"2024-11-21T11:28:09.570Z","updated_at":"2025-03-15T15:16:15.284Z","avatar_url":"https://github.com/moriyoshi.png","language":"Go","readme":"## simplefiletx\n\n[![godoc](https://godoc.org/github.com/moriyoshi/simplefiletx?status.svg)](https://godoc.org/github.com/moriyoshi/simplefiletx)\n\n[![travis-ci](https://travis-ci.com/moriyoshi/simplefiletx.svg?branch=master)](https://travis-ci.com/moriyoshi/simplefiletx)\n\nsimplefiletx is a protocol handler implementation for Go's `net.http`.\n\nIn contrast to Go's standard `FileTransport` implementation, it does:\n\n* Handle relative file paths like\n\n  `file:foo/bar/relative`\n\n  (Although the form violates RFC8089, it'd been quite common before the standard got out the door)\n\nAnd it does **not**: \n\n* Automatically render the directory content as HTML\n* Or try to find `index.html` under the directory and return its content\n\nwhen the resolved path corresponds to a directory in the filesystem. \n(This is pretty much not desired behavior when it comes to simply using URLs as an universal way to describe the resource location)\n\n### Synopsis\n\n```golang\nimport \"github.com/moriyoshi/simplefiletx\"\n\ntx := \u0026http.Transport{}\ntx.RegisterProtocol(\"file\", simplefiletx.NewSimpleFileTransport(\"/somewhere-in-the-filesystem\"))\nc := \u0026http.Client{Transport: tx}\nresp, err := c.Get(\"file:/test.txt\") // try to fetch \"/test.txt\"\nresp, err := c.Get(\"file:///test.txt\") // try to fetch \"/test.txt\"\nresp, err := c.Get(\"file://localhost/test.txt\") // try to fetch \"/test.txt\"\nresp, err := c.Get(\"file:test.txt\") // try to fetch \"/somewhere-in-the-filesystem/test.txt\"\n```\n\n### License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoriyoshi%2Fsimplefiletx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoriyoshi%2Fsimplefiletx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoriyoshi%2Fsimplefiletx/lists"}