Move RemoteInfo and CloneProto to info package
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
package config
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/info"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
// Named keys above maintained for backwards compatibility
|
||||
@ -9,9 +13,10 @@ type Config struct {
|
||||
GitlabToken string `yaml:"gitlabToken,omitempty" json:"gitlabToken,omitempty"`
|
||||
Gitlabs []GitlabConfig `yaml:"gitlabs" json:"gitlabs"`
|
||||
Giteas []GiteaConfig `yaml:"giteas" json:"giteas"`
|
||||
LogLevel string `yaml:"logLevel" json:"logLevel" enum:"info,warn,debug,error"`
|
||||
ProjectPath string `yaml:"projectPath" json:"projectPath"`
|
||||
Cache cacheConfig `yaml:"cache" json:"cache"`
|
||||
Remotes []info.RemoteInfo
|
||||
LogLevel string `yaml:"logLevel" json:"logLevel" enum:"info,warn,debug,error"`
|
||||
ProjectPath string `yaml:"projectPath" json:"projectPath"`
|
||||
Cache cacheConfig `yaml:"cache" json:"cache"`
|
||||
Dump struct {
|
||||
Full bool `yaml:"full" json:"full"`
|
||||
} `yaml:"dump" json:"dump"`
|
||||
@ -19,27 +24,19 @@ type Config struct {
|
||||
}
|
||||
|
||||
type GiteaConfig struct {
|
||||
Host string `yaml:"host" json:"host"`
|
||||
Name string `yaml:"name" json:"name"`
|
||||
Token string `yaml:"token" json:"token"`
|
||||
CloneProto CloneProto `yaml:"cloneProto" json:"cloneProto"`
|
||||
Host string `yaml:"host" json:"host"`
|
||||
Name string `yaml:"name" json:"name"`
|
||||
Token string `yaml:"token" json:"token"`
|
||||
CloneProto info.CloneProto `yaml:"cloneProto" json:"cloneProto"`
|
||||
}
|
||||
|
||||
type GitlabConfig struct {
|
||||
Host string `yaml:"host" json:"host"`
|
||||
Name string `yaml:"name" json:"name"`
|
||||
Token string `yaml:"token" json:"token"`
|
||||
CloneProto CloneProto `yaml:"cloneProto" json:"cloneProto"`
|
||||
Host string `yaml:"host" json:"host"`
|
||||
Name string `yaml:"name" json:"name"`
|
||||
Token string `yaml:"token" json:"token"`
|
||||
CloneProto info.CloneProto `yaml:"cloneProto" json:"cloneProto"`
|
||||
}
|
||||
|
||||
type CloneProto string
|
||||
|
||||
const (
|
||||
CloneProtoSSH CloneProto = "ssh"
|
||||
CloneProtoHTTP CloneProto = "http"
|
||||
DefaultCloneProto CloneProto = CloneProtoSSH
|
||||
)
|
||||
|
||||
type editorConfig struct {
|
||||
DisplayName string `yaml:"displanName,omitempty" json:"displanName,omitempty"`
|
||||
Binary string `yaml:"binary,omitempty" json:"binary,omitempty"`
|
||||
@ -69,7 +66,7 @@ var DefaultConfig = Config{
|
||||
Gitlabs: []GitlabConfig{{
|
||||
Host: "https://gitlab.com",
|
||||
Token: "yourtokenhere",
|
||||
CloneProto: CloneProtoSSH,
|
||||
CloneProto: info.CloneProtoSSH,
|
||||
Name: "GitLab",
|
||||
}},
|
||||
Cache: cacheConfig{
|
||||
|
Reference in New Issue
Block a user