{"id":21658354,"url":"https://github.com/src-d/go-billy","last_synced_at":"2025-12-15T22:02:35.105Z","repository":{"id":48797286,"uuid":"75849594","full_name":"src-d/go-billy","owner":"src-d","description":"The missing interface filesystem abstraction for Go","archived":false,"fork":false,"pushed_at":"2021-07-11T00:08:25.000Z","size":197,"stargazers_count":201,"open_issues_count":15,"forks_count":42,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-21T03:43:14.386Z","etag":null,"topics":["abstraction","filesystem","golang"],"latest_commit_sha":null,"homepage":"https://godoc.org/gopkg.in/src-d/go-billy.v4","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/src-d.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":"2016-12-07T15:32:53.000Z","updated_at":"2025-01-13T07:44:34.000Z","dependencies_parsed_at":"2022-08-23T14:21:18.633Z","dependency_job_id":null,"html_url":"https://github.com/src-d/go-billy","commit_stats":null,"previous_names":["src-d/billy"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-billy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-billy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-billy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-billy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/src-d","download_url":"https://codeload.github.com/src-d/go-billy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252013402,"owners_count":21680371,"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":["abstraction","filesystem","golang"],"created_at":"2024-11-25T09:29:08.507Z","updated_at":"2025-12-15T22:02:30.074Z","avatar_url":"https://github.com/src-d.png","language":"Go","readme":"## WE CONTINUE THE DEVELOPMENT AT [go-git/go-billy](https://github.com/go-git/go-billy). This repository is abandoned, and no further updates will be done on the code base, nor issue/prs will be answered or attended.\n\n# go-billy [![GoDoc](https://godoc.org/gopkg.in/src-d/go-billy.v4?status.svg)](https://godoc.org/gopkg.in/src-d/go-billy.v4) [![Build Status](https://travis-ci.com/src-d/go-billy.svg)](https://travis-ci.com/src-d/go-billy) [![Build status](https://ci.appveyor.com/api/projects/status/vx2qn6vlakbi724t?svg=true)](https://ci.appveyor.com/project/mcuadros/go-billy) [![codecov](https://codecov.io/gh/src-d/go-billy/branch/master/graph/badge.svg)](https://codecov.io/gh/src-d/go-billy)\n\nThe missing interface filesystem abstraction for Go.\nBilly implements an interface based on the `os` standard library, allowing to develop applications without dependency on the underlying storage. Makes it virtually free to implement mocks and testing over filesystem operations.\n\nBilly was born as part of [src-d/go-git](https://github.com/src-d/go-git) project.\n\n## Installation\n\n```go\ngo get -u gopkg.in/src-d/go-billy.v4/...\n```\n\n## Usage\n\nBilly exposes filesystems using the\n[`Filesystem` interface](https://godoc.org/github.com/src-d/go-billy#Filesystem).\nEach filesystem implementation gives you a `New` method, whose arguments depend on\nthe implementation itself, that returns a new `Filesystem`.\n\nThe following example caches in memory all readable files in a directory from any\nbilly's filesystem implementation.\n\n```go\nfunc LoadToMemory(origin billy.Filesystem, path string) (*memory.Memory, error) {\n\tmemory := memory.New()\n\n\tfiles, err := origin.ReadDir(\"/\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, file := range files {\n\t\tif file.IsDir() {\n\t\t\tcontinue\n\t\t}\n\n\t\tsrc, err := origin.Open(file.Name())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tdst, err := memory.Create(file.Name())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif _, err = io.Copy(dst, src); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := dst.Close(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif err := src.Close(); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn memory, nil\n}\n```\n\n## Why billy?\n\nThe library billy deals with storage systems and Billy is the name of a well-known, IKEA\nbookcase. That's it.\n\n## License\n\nApache License Version 2.0, see [LICENSE](LICENSE)\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fgo-billy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrc-d%2Fgo-billy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fgo-billy/lists"}