Skip to content

posener/githubapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

githubapp

GoDoc goreadme

Package githubapp provides oauth2 Github app authentication client.

According to https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps.

Usage

func main() {
	ctx := context.Background()
	cfg := githubapp.Config{
		AppID: "1234",
		PrivateKey: []byte(os.Getenv("GITHUB_APP_PRIVATE_KEY"))
	}
	c := cfg.Client(ctx)
	// Use c...
}

The created client can be used to create a github API client with the github.com/google/go-github/github library. Once your application will have installation, you would like to get application clients.

app := cfg.NewApp(ctx)
installation, err := app.Installation(ctx, "<github-login>")
// Check err and use installation...

The installation has an authenticated http client and github API client ready to be used.

Sub Packages


Created by goreadme

About

oauth2 Github app authentication client

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages