Documentation
¶
Index ¶
Constants ¶
View Source
const ( LatestInstalledStrategy = "latest_installed" LatestAvailableStrategy = "latest_available" SpecifiedStrategy = "specified" DefaultStrategy = SpecifiedStrategy )
Variables ¶
View Source
var ( DefaultConfig = &Config{ Proxy: EmptyProxy, Storage: EmptyStorage, Registry: EmptyRegistry, LegacyVersionFile: EmptyLegacyVersionFile, Cache: EmptyCache, } )
View Source
var EmptyLegacyVersionFile = &LegacyVersionFile{ Enable: true, Strategy: DefaultStrategy, }
View Source
var ( EmptyProxy = &Proxy{ Url: "", Enable: false, } )
View Source
var EmptyRegistry = &Registry{
Address: "",
}
View Source
var EmptyStorage = &Storage{
SdkPath: "",
}
Functions ¶
This section is empty.
Types ¶
type Cache ¶ added in v0.5.0
type Cache struct {
AvailableHookDuration cache.Duration `yaml:"availableHookDuration"` // Available hook result cache time
}
Cache is the cache configuration
type Config ¶
type Config struct {
Proxy *Proxy `yaml:"proxy"`
Storage *Storage `yaml:"storage"`
Registry *Registry `yaml:"registry"`
LegacyVersionFile *LegacyVersionFile `yaml:"legacyVersionFile"`
Cache *Cache `yaml:"cache"`
}
func LoadConfigWithFallback ¶ added in v1.0.0
LoadConfigWithFallback loads config from multiple paths with priority Priority: sharedPath (higher) > userPath (lower) If sharedPath doesn't exist or is empty, userConfig is used If both exist, they are merged with userConfig taking precedence for non-empty fields
func Merge ¶ added in v1.0.0
Merge merges two configs with userConfig taking precedence over sharedConfig Returns a new config where userConfig fields override sharedConfig fields If a field in userConfig is nil/empty, the sharedConfig value is used
func NewConfigWithPath ¶
func (*Config) SaveConfig ¶ added in v0.4.0
type LegacyVersionFile ¶ added in v0.4.0
type LegacyVersionFile struct {
Enable bool `yaml:"enable"`
// Support three strategies:
// 1. latest_installed: use the latest installed version
// 2. latest_available: use the latest available version
// 3. specified: use the specified version in the legacy file
// default: specified
Strategy string `yaml:"strategy"`
}
LegacyVersionFile represents whether to enable the ability to parse legacy version files,
Click to show internal directories.
Click to hide internal directories.