https://github.com/k1low/ghfs
:octocat: Go io/fs implementation for GitHub remote repository
https://github.com/k1low/ghfs
github golang iofs
Last synced: 10 months ago
JSON representation
:octocat: Go io/fs implementation for GitHub remote repository
- Host: GitHub
- URL: https://github.com/k1low/ghfs
- Owner: k1LoW
- License: mit
- Created: 2021-11-05T22:41:06.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-22T02:09:15.000Z (10 months ago)
- Last Synced: 2025-03-29T05:41:34.625Z (10 months ago)
- Topics: github, golang, iofs
- Language: Go
- Homepage:
- Size: 104 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ghfs [](https://github.com/k1LoW/ghfs/actions/workflows/ci.yml)
:octocat: `ghfs` implements the [io/fs](https://pkg.go.dev/io/fs) interfaces for GitHub remote repositories.
The implementation wraps [go-github](https://github.com/google/go-github) client and use [Git Database API](https://docs.github.com/en/rest/reference/git).
## Supported interface
- [fs.FS](https://pkg.go.dev/io/fs#FS)
- [fs.ReadFileFS](https://pkg.go.dev/io/fs#ReadFileFS)
- [fs.ReadDirFS](https://pkg.go.dev/io/fs#ReadDirFS)
- [fs.SubFS](https://pkg.go.dev/io/fs#SubFS)
## Usage
``` go
package main
import (
"fmt"
"io"
"log"
"github.com/k1LoW/ghfs"
)
func main() {
fsys, err := ghfs.New("golang", "time")
if err != nil {
log.Fatal(err)
}
f, err := fsys.Open("README.md")
if err != nil {
log.Fatal(err)
}
b, err := io.ReadAll(f)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", b)
}
```
## References
- [johejo/ghfs](https://github.com/johejo/ghfs): Package ghfs wraps the github v3 rest api with io/fs.