v3 work... lots of things

This commit is contained in:
zach rice committed 2019-11-10 13:30:43 -05:00
1 parent f3360cbf66
commit b55d88dc15
215 files changed
+5513 -4218

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
package hosts
import (
"github.com/zricethezav/gitleaks-ng/manager"
"strings"
)
const (
_github int = iota + 1
_gitlab
)
type Host interface {
Audit()
AuditPR()
}
func Run(m *manager.Manager) error {
var host Host
switch getHost(m.Opts.Host) {
case _github:
host = NewGithubClient(*m)
case _gitlab:
host = NewGitlabClient(*m)
default:
return nil
}
if m.Opts.PullRequest != "" {
host.AuditPR()
} else {
host.Audit()
}
return nil
}
func getHost(host string) int {
if strings.ToLower(host) == "github" {
return _github
} else if strings.ToLower(host) == "gitlab" {
return _gitlab
}
return -1
}