{"id":13645560,"url":"https://github.com/willscott/go-nfs","last_synced_at":"2025-04-10T20:10:00.635Z","repository":{"id":44742204,"uuid":"258840027","full_name":"willscott/go-nfs","owner":"willscott","description":"golang NFSv3 server","archived":false,"fork":false,"pushed_at":"2024-10-25T17:12:40.000Z","size":247,"stargazers_count":694,"open_issues_count":7,"forks_count":75,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-29T15:12:52.571Z","etag":null,"topics":["billy","golang","hacktoberfest","nfs","nfs-server","nfsv3"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willscott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-25T17:58:20.000Z","updated_at":"2024-10-29T11:38:37.000Z","dependencies_parsed_at":"2023-11-15T13:25:32.781Z","dependency_job_id":"2d13a5d4-aabb-4d87-860f-be53cf988f73","html_url":"https://github.com/willscott/go-nfs","commit_stats":{"total_commits":120,"total_committers":19,"mean_commits":6.315789473684211,"dds":0.6166666666666667,"last_synced_commit":"7a961c154868392b058cd9de63a7c59f552dab97"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgo-nfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgo-nfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgo-nfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgo-nfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willscott","download_url":"https://codeload.github.com/willscott/go-nfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248288351,"owners_count":21078903,"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":["billy","golang","hacktoberfest","nfs","nfs-server","nfsv3"],"created_at":"2024-08-02T01:02:37.269Z","updated_at":"2025-04-10T20:10:00.614Z","avatar_url":"https://github.com/willscott.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"Golang Network File Server\n===\n\nNFSv3 protocol implementation in pure Golang.\n\nCurrent Status:\n* Minimally tested\n* Mounts, read-only and read-write support\n\nUsage\n===\n\nThe most interesting demo is currently in `example/osview`. \n\nStart the server\n`go run ./example/osview .`.\n\nThe local folder at `.` will be the initial view in the mount. mutations to metadata or contents\nwill be stored purely in memory and not written back to the OS. When run, this\ndemo will print the port it is listening on.\n\nThe mount can be accessed using a command similar to \n`mount -o port=\u003cn\u003e,mountport=\u003cn\u003e -t nfs localhost:/mount \u003cmountpoint\u003e` (For Mac users)\n\nor\n\n`mount -o port=\u003cn\u003e,mountport=\u003cn\u003e,nfsvers=3,noacl,tcp -t nfs localhost:/mount \u003cmountpoint\u003e` (For Linux users)\n\nAPI\n===\n\nThe NFS server runs on a `net.Listener` to export a file system to NFS clients.\nUsage is structured similarly to many other golang network servers.\n\n```golang\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\n\t\"github.com/go-git/go-billy/v5/memfs\"\n\tnfs \"github.com/willscott/go-nfs\"\n\tnfshelper \"github.com/willscott/go-nfs/helpers\"\n)\n\nfunc main() {\n\tlistener, err := net.Listen(\"tcp\", \":0\")\n\tpanicOnErr(err, \"starting TCP listener\")\n\tfmt.Printf(\"Server running at %s\\n\", listener.Addr())\n\tmem := memfs.New()\n\tf, err := mem.Create(\"hello.txt\")\n\tpanicOnErr(err, \"creating file\")\n\t_, err = f.Write([]byte(\"hello world\"))\n\tpanicOnErr(err, \"writing data\")\n\tf.Close()\n\thandler := nfshelper.NewNullAuthHandler(mem)\n\tcacheHelper := nfshelper.NewCachingHandler(handler, 1)\n\tpanicOnErr(nfs.Serve(listener, cacheHelper), \"serving nfs\")\n}\n\nfunc panicOnErr(err error, desc ...interface{}) {\n\tif err == nil {\n\t\treturn\n\t}\n\tlog.Println(desc...)\n\tlog.Panicln(err)\n}\n```\n\nNotes\n---\n\n* Ports are typically determined through portmap. The need for running portmap \n(which is the only part that needs a privileged listening port) can be avoided\nthrough specific mount options. e.g. \n`mount -o port=n,mountport=n -t nfs host:/mount /localmount`\n\n* This server currently uses [billy](https://github.com/go-git/go-billy/) to\nprovide a file system abstraction layer. There are some edges of the NFS protocol\nwhich do not translate to this abstraction.\n  * NFS expects access to an `inode` or equivalent unique identifier to reference\n  files in a file system. These are considered opaque identifiers here, which\n  means they will not work as expected in cases of hard linking.\n  * The billy abstraction layer does not extend to exposing `uid` and `gid`\n  ownership of files. If ownership is important to your file system, you\n  will need to ensure that the `os.FileInfo` meets additional constraints.\n  In particular, the `Sys()` escape hatch is queried by this library, and\n  if your file system populates a [`syscall.Stat_t`](https://golang.org/pkg/syscall/#Stat_t)\n  concrete struct, the ownership specified in that object will be used.\n  You can also return a [`file.FileInfo`](https://github.com/willscott/go-nfs/blob/master/file/file.go#L5)\n  which doesn't vary between platforms so may be easier to deal with.\n\n* Relevant RFCS:\n[5531 - RPC protocol](https://tools.ietf.org/html/rfc5531),\n[1813 - NFSv3](https://tools.ietf.org/html/rfc1813),\n[1094 - NFS](https://tools.ietf.org/html/rfc1094)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillscott%2Fgo-nfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillscott%2Fgo-nfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillscott%2Fgo-nfs/lists"}