Remove all legacy config

This commit is contained in:
2024-01-17 16:56:41 -05:00
parent 1c373ff00f
commit 4b389fca1c
13 changed files with 101 additions and 142 deletions

View File

@ -9,10 +9,6 @@ import (
type Config struct {
// Named keys above maintained for backwards compatibility
// Ideally only Gitlabs is used
GitlabHost string `yaml:"gitlabHost,omitempty" json:"gitlabHost,omitempty"`
GitlabToken string `yaml:"gitlabToken,omitempty" json:"gitlabToken,omitempty"`
Gitlabs []GitlabConfig `yaml:"gitlabs" json:"gitlabs"`
Giteas []GiteaConfig `yaml:"giteas" json:"giteas"`
Remotes []info.RemoteInfo
LogLevel string `yaml:"logLevel" json:"logLevel" enum:"info,warn,debug,error"`
ProjectPath string `yaml:"projectPath" json:"projectPath"`
@ -23,20 +19,6 @@ type Config struct {
Editor editorConfig `yaml:"editor" json:"editor"`
}
type GiteaConfig struct {
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 info.CloneProto `yaml:"cloneProto" json:"cloneProto"`
}
type editorConfig struct {
DisplayName string `yaml:"displanName,omitempty" json:"displanName,omitempty"`
Binary string `yaml:"binary,omitempty" json:"binary,omitempty"`
@ -63,11 +45,12 @@ type cacheConfig struct {
var DefaultConfig = Config{
LogLevel: "warn",
ProjectPath: "~/work/projects",
Gitlabs: []GitlabConfig{{
Remotes: []info.RemoteInfo{{
Host: "https://gitlab.com",
Token: "yourtokenhere",
CloneProto: info.CloneProtoSSH,
Name: "GitLab",
Type: "gitlab",
}},
Cache: cacheConfig{
Ttl: 168 * time.Hour,