/
schema.go
31 lines (28 loc) · 986 Bytes
/
schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package gitops
import "github.com/litmuschaos/litmus/litmus-portal/graphql-server/graph/model"
// GitConfigDB ...
type GitConfigDB struct {
ProjectID string `bson:"project_id"`
RepositoryURL string `bson:"repo_url"`
Branch string `bson:"branch"`
LatestCommit string `bson:"latest_commit"`
AuthType model.AuthType `bson:"auth_type"`
UserName *string `bson:"username"`
Password *string `bson:"password"`
Token *string `bson:"token"`
SSHPrivateKey *string `bson:"ssh_private_key"`
}
// GetGitConfigDB ...
func GetGitConfigDB(config model.GitConfig) GitConfigDB {
return GitConfigDB{
ProjectID: config.ProjectID,
RepositoryURL: config.RepoURL,
Branch: config.Branch,
LatestCommit: "",
AuthType: config.AuthType,
UserName: config.UserName,
Password: config.Password,
Token: config.Token,
SSHPrivateKey: config.SSHPrivateKey,
}
}