Move RemoteInfo and CloneProto to info package
This commit is contained in:
@ -4,24 +4,28 @@ import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
|
||||
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/info"
|
||||
)
|
||||
|
||||
type GiteaRemote struct {
|
||||
info *remote.RemoteInfo
|
||||
info *info.RemoteInfo
|
||||
api *gitea.Client
|
||||
}
|
||||
|
||||
func (r *GiteaRemote) GetInfo() *remote.RemoteInfo {
|
||||
func (r *GiteaRemote) GetInfo() *info.RemoteInfo {
|
||||
return r.info
|
||||
}
|
||||
|
||||
func (r *GiteaRemote) GetType() string {
|
||||
return r.info.Type
|
||||
}
|
||||
|
||||
func (r *GiteaRemote) String() string {
|
||||
return fmt.Sprintf("Gitea %s (%s), clone proto %s",
|
||||
r.GetInfo().Name, r.GetInfo().Host, r.GetInfo().CloneProto)
|
||||
}
|
||||
|
||||
func NewGiteaRemote(remoteInfo *remote.RemoteInfo) (*GiteaRemote, error) {
|
||||
func NewGiteaRemote(remoteInfo *info.RemoteInfo) (*GiteaRemote, error) {
|
||||
client, err := gitea.NewClient(remoteInfo.Host,
|
||||
gitea.SetContext(remoteInfo.Ctx),
|
||||
gitea.SetToken(remoteInfo.Token),
|
||||
|
Reference in New Issue
Block a user