Start moving gitlab code to remote interface
This commit is contained in:
27
internal/remotes/gitlab/gitlab.go
Normal file
27
internal/remotes/gitlab/gitlab.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package gitlabremote
|
||||
|
||||
import (
|
||||
"github.com/xanzy/go-gitlab"
|
||||
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
|
||||
)
|
||||
|
||||
type GitlabRemote struct {
|
||||
info *remote.RemoteInfo
|
||||
api *gitlab.Client
|
||||
}
|
||||
|
||||
func (r *GitlabRemote) GetInfo() *remote.RemoteInfo {
|
||||
return r.info
|
||||
}
|
||||
|
||||
func NewGitlabRemote(remoteInfo *remote.RemoteInfo) (*GitlabRemote, error) {
|
||||
api, err := NewGitlabApi(remoteInfo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
gl := &GitlabRemote{
|
||||
info: remoteInfo,
|
||||
api: api,
|
||||
}
|
||||
return gl, nil
|
||||
}
|
||||
Reference in New Issue
Block a user