Properly abstract deployment asset downlod
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package gitprovider
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func NewProvider(serverType, protocol, baseUrl string) (GitProvider, error) {
|
||||
switch strings.ToLower(serverType) {
|
||||
case "github":
|
||||
return &GitHubProvider{
|
||||
protocol: protocol,
|
||||
baseUrl: baseUrl,
|
||||
}, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported git provider: %s", serverType)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user