{"id":20517955,"url":"https://github.com/vansante/go-network-file","last_synced_at":"2026-05-27T13:35:43.389Z","repository":{"id":92188857,"uuid":"212974684","full_name":"vansante/go-network-file","owner":"vansante","description":"Provides an io.ReadSeeker and io.WriteSeeker interface over the network.","archived":false,"fork":false,"pushed_at":"2026-03-12T16:06:55.000Z","size":143,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"v2","last_synced_at":"2026-03-12T22:37:35.895Z","etag":null,"topics":["file-reader","file-writer","golang","golang-library","network-server"],"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/vansante.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":"2019-10-05T09:31:29.000Z","updated_at":"2026-03-12T16:07:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"cbc3d236-d454-4da2-8282-229bcf5852af","html_url":"https://github.com/vansante/go-network-file","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/vansante/go-network-file","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansante%2Fgo-network-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansante%2Fgo-network-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansante%2Fgo-network-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansante%2Fgo-network-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vansante","download_url":"https://codeload.github.com/vansante/go-network-file/tar.gz/refs/heads/v2","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vansante%2Fgo-network-file/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33568857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"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":["file-reader","file-writer","golang","golang-library","network-server"],"created_at":"2024-11-15T21:37:58.891Z","updated_at":"2026-05-27T13:35:43.372Z","avatar_url":"https://github.com/vansante.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-network-file\nProvides an io.ReaderAt and io.WriterAt interface over the network using simple HTTP calls.\n\n## Installation\n\n```\ngo get gopkg.in/vansante/go-network-file.v2\n```\n\n## Documentation\n\nhttps://pkg.go.dev/gopkg.in/vansante/go-network-file.v2\n\n\n## Basic usage\n\nTo start a file server, do:\n\n```golang\nsrv := NewFileServer(\"/my-files\", \"mySecretCode\")\nerr := http.ListenAndServe(\":8080\", srv)\nif err != nil {\n    panic(err)\n}\n```\n\nNow we want to create a file that we can write to remotely:\n\n```golang\nfile, err := os.CreateTemp(os.TempDir(), \"New Test File.txt\")\nassert.NoError(t, err)\ndefer func() {\n    _ = file.Close()\n}()\n\nctx, cancelFn := context.WithTimeout(context.Background(), time.Minute)\ndefer cancelFn()\n\nerr = srv.ServeFileWriter(ctx, fileID, dst)\nif err != nil {\n    panic(err)\n}\n```\n\nThen on the client side, we open a writer for this file:\n\n```golang\nctx, cancelFn := context.WithTimeout(context.Background(), time.Minute)\ndefer cancelFn()\n\nwrtr := NewWriter(ctx, \"http://my-file-server:8080/my-files\", \"mySecretCode\", fileID)\n_, err := wrtr.Write([]byte(\"Hello, World!\"))\nif err != nil {\n    panic(err)\n}\nerr = wrtr.Close()\nif err != nil {\n    panic(err)\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvansante%2Fgo-network-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvansante%2Fgo-network-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvansante%2Fgo-network-file/lists"}