Documentation
¶
Overview ¶
Package config provides configuration file support for JVS.
Index ¶
- func InvalidateCache(repoRoot string)
- func Keys() []string
- func Save(repoRoot string, cfg *Config) error
- type Config
- func (c *Config) Get(key string) (string, error)
- func (c *Config) GetDefaultEngine() model.EngineType
- func (c *Config) GetDefaultTags() []string
- func (c *Config) GetOutputFormat() string
- func (c *Config) GetProgressEnabled() *bool
- func (c *Config) GetRetentionPolicy() model.RetentionPolicy
- func (c *Config) Set(key, value string) error
- type RetentionPolicy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvalidateCache ¶
func InvalidateCache(repoRoot string)
InvalidateCache clears the cached config for a repository.
Types ¶
type Config ¶
type Config struct {
// DefaultEngine is the default snapshot engine to use.
DefaultEngine model.EngineType `yaml:"default_engine,omitempty"`
// DefaultTags are tags automatically added to each snapshot.
DefaultTags []string `yaml:"default_tags,omitempty"`
// OutputFormat is the default output format (text or json).
OutputFormat string `yaml:"output_format,omitempty"`
// ProgressEnabled enables progress bars by default.
ProgressEnabled *bool `yaml:"progress_enabled,omitempty"`
// Retention preserves legacy YAML compatibility for internal GC policy
// conversion. The v0 public CLI does not expose retention configuration.
Retention *RetentionPolicy `yaml:"retention,omitempty"`
}
Config represents the JVS configuration.
func Load ¶
Load loads configuration from .jvs/config.yaml. Returns default config if file doesn't exist. The returned Config must not be modified; use Save() for changes.
func (*Config) GetDefaultEngine ¶
func (c *Config) GetDefaultEngine() model.EngineType
GetDefaultEngine returns the default engine, or empty string if not set.
func (*Config) GetDefaultTags ¶
GetDefaultTags returns the default tags.
func (*Config) GetOutputFormat ¶
GetOutputFormat returns the output format, or empty string if not set.
func (*Config) GetProgressEnabled ¶
GetProgressEnabled returns whether progress is enabled. Returns nil if not configured (auto-detect based on terminal).
func (*Config) GetRetentionPolicy ¶
func (c *Config) GetRetentionPolicy() model.RetentionPolicy
GetRetentionPolicy returns the legacy retention config as a model.RetentionPolicy.
type RetentionPolicy ¶
type RetentionPolicy struct {
// Keep is the minimum number of snapshots to keep.
Keep int `yaml:"keep,omitempty"`
// Within is the minimum age before snapshots can be pruned (e.g., "24h", "168h").
Within string `yaml:"within,omitempty"`
}
RetentionPolicy is a legacy config shape for optional internal GC retention. Unset or invalid values fall back to model.DefaultRetentionPolicy().