https://github.com/posener/githubapp
oauth2 Github app authentication client
https://github.com/posener/githubapp
github github-api go golang oauth2
Last synced: 10 months ago
JSON representation
oauth2 Github app authentication client
- Host: GitHub
- URL: https://github.com/posener/githubapp
- Owner: posener
- Created: 2019-03-12T18:36:47.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-14T20:42:32.000Z (almost 7 years ago)
- Last Synced: 2024-10-05T12:42:33.244Z (over 1 year ago)
- Topics: github, github-api, go, golang, oauth2
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# githubapp
[](http://godoc.org/github.com/posener/githubapp)
[](https://goreadme.herokuapp.com)
Package githubapp provides oauth2 Github app authentication client.
According to [https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps).
Usage
```go
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.
```go
app := cfg.NewApp(ctx)
installation, err := app.Installation(ctx, "")
// Check err and use installation...
```
The installation has an authenticated http client and github API client
ready to be used.
## Sub Packages
* [cache](./cache)
---
Created by [goreadme](https://github.com/apps/goreadme)