Refactor GitProvider to take in auth token
This commit is contained in:
@@ -5,12 +5,13 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func NewProvider(serverType, protocol, baseUrl string) (GitProvider, error) {
|
||||
func NewProvider(serverType, protocol, baseUrl, authToken string) (GitProvider, error) {
|
||||
switch strings.ToLower(serverType) {
|
||||
case "github":
|
||||
return &GitHubProvider{
|
||||
protocol: protocol,
|
||||
baseUrl: baseUrl,
|
||||
protocol: protocol,
|
||||
baseUrl: baseUrl,
|
||||
authToken: authToken,
|
||||
}, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported git provider: %s", serverType)
|
||||
|
||||
Reference in New Issue
Block a user