diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-24 19:22:32 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-24 19:22:32 +0200 |
commit | c4a207622a894ba9839f1a3c47c9d78beff9b861 (patch) | |
tree | 009d80b363b5392e6eba4bec85b0ae74b3942995 /bridge/github/github.go | |
parent | c86e7231b223d532e26ab5449715c65b6b4e3fde (diff) | |
download | git-bug-c4a207622a894ba9839f1a3c47c9d78beff9b861.tar.gz |
github: query most of the data
Diffstat (limited to 'bridge/github/github.go')
-rw-r--r-- | bridge/github/github.go | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/bridge/github/github.go b/bridge/github/github.go index 4f7a3b94..a8371637 100644 --- a/bridge/github/github.go +++ b/bridge/github/github.go @@ -1,10 +1,11 @@ package github import ( - "fmt" + "context" "github.com/MichaelMure/git-bug/bridge/core" - "github.com/MichaelMure/git-bug/cache" + "github.com/shurcooL/githubv4" + "golang.org/x/oauth2" ) func init() { @@ -25,18 +26,11 @@ func (*Github) Exporter() core.Exporter { return nil } -type githubImporter struct{} +func buildClient(conf core.Configuration) *githubv4.Client { + src := oauth2.StaticTokenSource( + &oauth2.Token{AccessToken: conf[keyToken]}, + ) + httpClient := oauth2.NewClient(context.TODO(), src) -func (*githubImporter) ImportAll(repo *cache.RepoCache, conf core.Configuration) error { - fmt.Println(conf) - fmt.Println("IMPORT ALL") - - return nil -} - -func (*githubImporter) Import(repo *cache.RepoCache, conf core.Configuration, id string) error { - fmt.Println(conf) - fmt.Println("IMPORT") - - return nil + return githubv4.NewClient(httpClient) } |