https://github.com/johejo/ghfs
Package ghfs wraps the github v3 rest api with io/fs.
https://github.com/johejo/ghfs
filesystem fs github github-api-v3 go golang io iofs
Last synced: 5 months ago
JSON representation
Package ghfs wraps the github v3 rest api with io/fs.
- Host: GitHub
- URL: https://github.com/johejo/ghfs
- Owner: johejo
- License: mit
- Created: 2021-01-23T01:15:34.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-23T02:06:52.000Z (over 3 years ago)
- Last Synced: 2024-06-19T05:56:52.352Z (over 1 year ago)
- Topics: filesystem, fs, github, github-api-v3, go, golang, io, iofs
- Language: Go
- Homepage:
- Size: 62.5 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ghfs
[](https://github.com/johejo/ghfs/actions?query=workflow%3Aci)
[](https://pkg.go.dev/github.com/johejo/ghfs)
[](https://codecov.io/gh/johejo/ghfs)
[](https://goreportcard.com/report/github.com/johejo/ghfs)
Package ghfs wraps the github v3 rest api with io/fs.
Files in the repository can be read in the same way as local files.
## Example
```go
package ghfs_test
import (
"context"
"io"
"os"
"github.com/johejo/ghfs"
"golang.org/x/oauth2"
)
func Example() {
ctx := context.Background()
ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")})
c := oauth2.NewClient(ctx, ts)
fsys := ghfs.New(c, "golang", "go")
f, err := fsys.Open("README.md")
if err != nil {
panic(err)
}
io.Copy(os.Stdout, f)
}
```
## License
MIT
## Author
Mitsuo Heijo