Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-12-07 02:35:30 +03:00
parent 8729d0b88e
commit c5f3fa325e
42 changed files with 1316 additions and 2009 deletions

View File

@@ -3,12 +3,13 @@ package source
import (
"context"
"git.unistack.org/unistack-org/pkgdash/internal/configcli"
"git.unistack.org/unistack-org/pkgdash/internal/modules"
"git.unistack.org/unistack-org/pkgdash/internal/source/gitea"
"git.unistack.org/unistack-org/pkgdash/internal/source/github"
"git.unistack.org/unistack-org/pkgdash/internal/source/gitlab"
"git.unistack.org/unistack-org/pkgdash/internal/source/gogs"
"go.unistack.org/micro/v3/logger"
"go.unistack.org/pkgdash/internal/configcli"
"go.unistack.org/pkgdash/internal/modules"
"go.unistack.org/pkgdash/internal/source/gitea"
"go.unistack.org/pkgdash/internal/source/github"
"go.unistack.org/pkgdash/internal/source/gitlab"
"go.unistack.org/pkgdash/internal/source/gogs"
)
type SourceControl interface {
@@ -19,16 +20,16 @@ type SourceControl interface {
RequestList(ctx context.Context, branch string) (map[string]string, error)
}
func NewSourceControl(cfg configcli.Config) SourceControl {
func NewSourceControl(cfg configcli.Config, log logger.Logger) SourceControl {
switch cfg.Source.TypeGit {
case "github":
return github.NewGithub(cfg)
return github.NewGithub(cfg, log)
case "gitlab":
return gitlab.NewGitlab(cfg)
return gitlab.NewGitlab(cfg, log)
case "gitea":
return gitea.NewGitea(cfg)
return gitea.NewGitea(cfg, log)
case "gogs":
return gogs.NewGogs(cfg)
return gogs.NewGogs(cfg, log)
}
return nil
}