pkg/ghclient/core.go
func NewClient(token string, dryRun bool) *Client {
	httpClient := &http.Client{
		Transport: &oauth2.Transport{
			Base:   http.DefaultTransport,
			Source: oauth2.ReuseTokenSource(nil, oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})),
		},
	}
	client := github.NewClient(httpClient)
	return &Client{
		issueService:        client.Issues,
		prService:           client.PullRequests,
		repoService:         client.Repositories,
		userService:         client.Users,
		retries:             5,
		retryInitialBackoff: time.Second,
		tokenReserve:        50,
		dryRun:              dryRun,
	}
}
func NewClient(token string, dryRun bool) *Client {
	httpClient := &http.Client{
		Transport: &oauth2.Transport{
			Base:   http.DefaultTransport,
			Source: oauth2.ReuseTokenSource(nil, oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})),
		},
	}
	client := github.NewClient(httpClient)
	return &Client{
		issueService:        client.Issues,
		prService:           client.PullRequests,
		repoService:         client.Repositories,
		userService:         client.Users,
		retries:             5,
		retryInitialBackoff: time.Second,
		tokenReserve:        50,
		dryRun:              dryRun,
	}
}
func NewClient ( token string , dryRun bool ) * Client { httpClient := & http . Client { Transport : & oauth2 . Transport { Base : http . DefaultTransport , Source : oauth2 . ReuseTokenSource ( nil , oauth2 . StaticTokenSource ( & oauth2 . Token { AccessToken : token } ) ) , } , } client := github . NewClient ( httpClient ) return & Client { issueService : client . Issues , prService : client . PullRequests , repoService : client . Repositories , userService : client . Users , retries : 5 , retryInitialBackoff : time . Second , tokenReserve : 50 , dryRun : dryRun , } }
// NewClient makes a new Client with the specified token and dry-run status.
NewClient makes a new Client with the specified token and dry - run status .