SkillAgentSearch skills...

Ghfs

Package ghfs wraps the github v3 rest api with io/fs.

Install / Use

/learn @johejo/Ghfs
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

ghfs

ci Go Reference codecov Go Report Card

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

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

Related Skills

View on GitHub
GitHub Stars9
CategoryDevelopment
Updated2y ago
Forks0

Languages

Go

Security Score

75/100

Audited on Jan 27, 2024

No findings