refactor(*): clean up code

This commit is contained in:
Nightapes
2019-06-15 23:03:27 +02:00
parent 1bc7f4bc67
commit cf0431846b
15 changed files with 517 additions and 405 deletions

View File

@@ -0,0 +1,19 @@
package util
import (
"context"
"net/http"
"golang.org/x/oauth2"
)
//CreateBearerHTTPClient with given token
func CreateBearerHTTPClient(ctx context.Context, token string) *http.Client {
tokenSource := oauth2.StaticTokenSource(&oauth2.Token{
AccessToken: token},
)
client := oauth2.NewClient(ctx, tokenSource)
return client
}