Documentation
¶
Overview ¶
Package config provides global configuration for revoco.
Index ¶
- func ConfigDir() (string, error)
- func ConfigPath() (string, error)
- func NormalizeChannel(channel string) string
- func Reload() error
- func ValidateChannel(channel string) error
- type Config
- func (c *Config) IsVersionSkipped(version string) bool
- func (c *Config) RecordPluginCheck() error
- func (c *Config) RecordUpdateCheck() error
- func (c *Config) Save() error
- func (c *Config) SaveTo(path string) error
- func (c *Config) ShouldCheckForPluginUpdates() bool
- func (c *Config) ShouldCheckForUpdates() bool
- func (c *Config) SkipVersion(version string) error
- type PluginConfig
- type TelemetryConfig
- type UpdateConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeChannel ¶ added in v0.1.11
NormalizeChannel ensures the channel is valid, defaulting to "stable" for unrecognized values.
func ValidateChannel ¶ added in v0.1.11
ValidateChannel validates that the channel is either "stable" or "dev".
Types ¶
type Config ¶
type Config struct {
// Update settings
Updates UpdateConfig `json:"updates"`
// Plugin settings
Plugins PluginConfig `json:"plugins"`
// Telemetry settings (for future use)
Telemetry TelemetryConfig `json:"telemetry,omitempty"`
}
Config holds the global revoco configuration.
func (*Config) IsVersionSkipped ¶
IsVersionSkipped checks if a version has been skipped.
func (*Config) RecordPluginCheck ¶
RecordPluginCheck updates the last plugin check timestamp.
func (*Config) RecordUpdateCheck ¶
RecordUpdateCheck updates the last update check timestamp.
func (*Config) ShouldCheckForPluginUpdates ¶
ShouldCheckForPluginUpdates returns true if a plugin update check should be performed.
func (*Config) ShouldCheckForUpdates ¶
ShouldCheckForUpdates returns true if an update check should be performed.
func (*Config) SkipVersion ¶
SkipVersion marks a version as skipped.
type PluginConfig ¶
type PluginConfig struct {
// AutoUpdate enables automatic plugin updates
AutoUpdate bool `json:"auto_update"`
// AutoUpdateInterval is how often to check for plugin updates
AutoUpdateInterval string `json:"auto_update_interval"`
// LastPluginCheck is the timestamp of the last plugin update check
LastPluginCheck time.Time `json:"last_plugin_check,omitempty"`
// RegistryURL is a custom plugin registry URL
RegistryURL string `json:"registry_url,omitempty"`
}
PluginConfig holds plugin-related global settings.
type TelemetryConfig ¶
type TelemetryConfig struct {
// Enabled controls whether anonymous usage data is collected
Enabled bool `json:"enabled"`
// MachineID is an anonymous identifier
MachineID string `json:"machine_id,omitempty"`
}
TelemetryConfig holds telemetry settings.
type UpdateConfig ¶
type UpdateConfig struct {
// AutoCheck enables automatic update checking on startup
AutoCheck bool `json:"auto_check"`
// AutoCheckInterval is how often to check for updates (e.g., "24h")
AutoCheckInterval string `json:"auto_check_interval"`
// AutoInstall enables automatic installation of updates
AutoInstall bool `json:"auto_install"`
// IncludePrerelease includes pre-release versions in update checks
IncludePrerelease bool `json:"include_prerelease"`
// LastCheck is the timestamp of the last update check
LastCheck time.Time `json:"last_check,omitempty"`
// SkippedVersion is a version the user chose to skip
SkippedVersion string `json:"skipped_version,omitempty"`
// Channel is the update channel (stable, dev)
Channel string `json:"channel"`
}
UpdateConfig holds update-related settings.