Documentation
¶
Index ¶
Constants ¶
const ( LatestInstalledStrategy = "latest_installed" LatestAvailableStrategy = "latest_available" SpecifiedStrategy = "specified" DefaultStrategy = SpecifiedStrategy )
Variables ¶
var ( DefaultConfig = &Config{ Plugin: Plugin{HTTP: &HTTP{}}, Proxy: EmptyProxy, Storage: EmptyStorage, Registry: EmptyRegistry, LegacyVersionFile: EmptyLegacyVersionFile, Cache: EmptyCache, Gitignore: EmptyGitignore, } )
var EmptyGitignore = &Gitignore{ Enable: true, }
var EmptyLegacyVersionFile = &LegacyVersionFile{ Enable: true, Strategy: DefaultStrategy, }
var ( EmptyProxy = &Proxy{ Url: "", Enable: false, } )
var EmptyRegistry = &Registry{
Address: "",
}
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 {
Plugin Plugin `yaml:"plugin"`
Proxy *Proxy `yaml:"proxy"`
Storage *Storage `yaml:"storage"`
Registry *Registry `yaml:"registry"`
LegacyVersionFile *LegacyVersionFile `yaml:"legacyVersionFile"`
Cache *Cache `yaml:"cache"`
Gitignore *Gitignore `yaml:"gitignore"`
}
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 Gitignore ¶ added in v1.0.12
type Gitignore struct {
Enable bool `yaml:"enable"`
}
Gitignore controls whether vfox automatically updates the project's .gitignore file when using a project-scoped version.
type HTTP ¶ added in v1.0.12
type HTTP struct {
Timeout time.Duration `yaml:"timeout"`
DownloadTimeout time.Duration `yaml:"downloadTimeout"`
}
HTTP configures the Lua HTTP module. Zero inherits the shared setting, or uses the built-in default when no shared setting is provided.
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,