1
0
mirror of https://github.com/IceWhaleTech/CasaOS.git synced 2025-07-06 23:37:26 +02:00

first commit

This commit is contained in:
a624669980
2021-09-26 10:35:02 +08:00
commit 7fb9bd1d06
195 changed files with 36650 additions and 0 deletions

25
pkg/github/github.go Normal file
View File

@ -0,0 +1,25 @@
package github
import (
"context"
"github.com/google/go-github/v36/github"
"golang.org/x/oauth2"
)
func GetGithubClient() *github.Client {
ctx := context.Background()
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: "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"},
)
tc := oauth2.NewClient(ctx, ts)
client := github.NewClient(tc)
return client
// list all repositories for the authenticated user
//repos, _, err := client.Repositories.List(ctx, "", nil)
//fmt.Print(err)
//fmt.Print(repos)
}