Bug fixes, config generator
This commit is contained in:
@ -13,13 +13,28 @@ type Config struct {
|
||||
}
|
||||
}
|
||||
|
||||
type cacheConfig struct {
|
||||
Ttl time.Duration `yaml:"ttl" json:"ttl"`
|
||||
File string `yaml:"file" json:"file"`
|
||||
Load struct {
|
||||
OwnerOnly bool `yaml:"ownerOnly" json:"ownerOnly"`
|
||||
} `yaml:"load" json:"load"`
|
||||
Clear struct {
|
||||
ClearAliases bool `yaml:"clearAliases" json:"clearAliases"`
|
||||
} `yaml:"clear" json:"clear"`
|
||||
type loadConfig struct {
|
||||
OwnerOnly bool `yaml:"ownerOnly" json:"ownerOnly"`
|
||||
}
|
||||
|
||||
type cacheConfig struct {
|
||||
Ttl time.Duration `yaml:"ttl,omitempty" json:"ttl,omitempty"`
|
||||
File string `yaml:"file,omitempty" json:"file,omitempty"`
|
||||
Load loadConfig `yaml:"load" json:"load"`
|
||||
Clear struct {
|
||||
ClearAliases bool `yaml:"clearAliases,omitempty" json:"clearAliases,omitempty"`
|
||||
} `yaml:"clear,omitempty" json:"clear,omitempty"`
|
||||
}
|
||||
|
||||
var DefaultConfig = Config{
|
||||
GitlabHost: "https://gitlab.com",
|
||||
GitlabToken: "yourtokenhere",
|
||||
LogLevel: "warn",
|
||||
ProjectPath: "~/work/projects",
|
||||
Cache: cacheConfig{
|
||||
Ttl: 168 * time.Hour,
|
||||
Load: loadConfig{
|
||||
OwnerOnly: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user