feat: added fields to models

This commit is contained in:
Marvin Zhang
2024-06-19 00:17:36 +08:00
parent 9d21bad931
commit b757826867
5 changed files with 67 additions and 212 deletions

View File

@@ -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)
}
}