mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
feat: added fields to models
This commit is contained in:
@@ -3,7 +3,6 @@ package utils
|
||||
import (
|
||||
"github.com/crawlab-team/crawlab/core/constants"
|
||||
"github.com/crawlab-team/crawlab/core/interfaces"
|
||||
"github.com/crawlab-team/crawlab/core/models/models"
|
||||
vcs "github.com/crawlab-team/crawlab/vcs"
|
||||
)
|
||||
|
||||
@@ -20,17 +19,3 @@ func InitGitClientAuth(g interfaces.Git, gitClient *vcs.GitClient) {
|
||||
gitClient.SetPrivateKey(g.GetPassword())
|
||||
}
|
||||
}
|
||||
|
||||
func InitGitClientAuthV2(g *models.GitV2, gitClient *vcs.GitClient) {
|
||||
// set auth
|
||||
switch g.AuthType {
|
||||
case constants.GitAuthTypeHttp:
|
||||
gitClient.SetAuthType(vcs.GitAuthTypeHTTP)
|
||||
gitClient.SetUsername(g.Username)
|
||||
gitClient.SetPassword(g.Password)
|
||||
case constants.GitAuthTypeSsh:
|
||||
gitClient.SetAuthType(vcs.GitAuthTypeSSH)
|
||||
gitClient.SetUsername(g.Username)
|
||||
gitClient.SetPrivateKey(g.Password)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user