Skip to content

johejo/ghfs

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy