Start moving gitlab code to remote interface

This commit is contained in:
2024-01-16 11:15:52 -05:00
parent e846821c44
commit d7181b1cf6
11 changed files with 339 additions and 186 deletions

View File

@@ -10,6 +10,7 @@ import (
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/config"
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes"
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
"gopkg.in/yaml.v3"
)
@@ -26,6 +27,7 @@ type Cache struct {
log *pterm.Logger
path string
gitlabs *remotes.Clients
remotes *remote.Remotes
}
type CacheOpts struct {
@@ -34,6 +36,7 @@ type CacheOpts struct {
TTL time.Duration
Logger *pterm.Logger
Gitlabs *remotes.Clients
Remotes *remote.Remotes
Config *config.Config
}
@@ -211,6 +214,7 @@ func NewProjectCache(opts *CacheOpts) (*Cache, error) {
contentLock: &sync.Mutex{},
log: opts.Logger,
gitlabs: gitlabs,
remotes: remote.NewRemotes(),
path: opts.ProjectsPath,
}