Documentation
¶
Index ¶
- func EnsureDirs() error
- func StateDir() string
- type Config
- func (c *Config) AllBasePaths() []string
- func (c *Config) GetBranchPrefix() string
- func (c *Config) GetTerminal() string
- func (c *Config) IsAuthor(login string) bool
- func (c *Config) RepoBasePath(short string) string
- func (c *Config) RepoFullName(short string) string
- func (c *Config) RepoNames() []string
- func (c *Config) RepoShortName(full string) string
- type RepoConfig
- type WatchConfig
- func (w WatchConfig) CleanupIntervalDuration() time.Duration
- func (w WatchConfig) DigestIntervalDuration() (time.Duration, bool)
- func (w WatchConfig) DispatchIntervalDuration() time.Duration
- func (w WatchConfig) GetCleanupAfterDays() int
- func (w WatchConfig) GetConcurrency() int
- func (w WatchConfig) GetMaxRetries() int
- func (w WatchConfig) SessionScanIntervalDuration() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Repos map[string]RepoConfig `yaml:"repos"`
WatchPaths []string `yaml:"watch_paths"`
Authors []string `yaml:"authors"`
PollInterval string `yaml:"poll_interval"`
ClaudeBin string `yaml:"claude_bin"`
Terminal string `yaml:"terminal"` // "iterm" or "ghostty"
BranchPrefix string `yaml:"branch_prefix"`
Watch WatchConfig `yaml:"watch"`
}
Config holds the complete zen configuration.
func Load ¶
Load reads the YAML config from ~/.zen/config.yaml. Returns an error if the config file does not exist or is invalid.
func (*Config) AllBasePaths ¶ added in v0.7.0
AllBasePaths returns all configured repo base paths.
func (*Config) GetBranchPrefix ¶ added in v0.7.0
GetBranchPrefix returns the prefix for feature branch names. Falls back to git config user.name (with spaces replaced by hyphens), then empty string.
func (*Config) GetTerminal ¶ added in v0.7.0
GetTerminal returns the configured terminal type.
func (*Config) RepoBasePath ¶
RepoBasePath returns the local base path for a repo (the parent dir that contains the main clone directory).
func (*Config) RepoFullName ¶
RepoFullName maps a short name to full GitHub owner/repo.
func (*Config) RepoShortName ¶
RepoShortName maps a full GitHub owner/repo to short name.
type RepoConfig ¶
RepoConfig holds per-repository configuration.
type WatchConfig ¶
type WatchConfig struct {
DispatchInterval string `yaml:"dispatch_interval"` // default "10s"
CleanupInterval string `yaml:"cleanup_interval"` // default "1h"
SessionScanInterval string `yaml:"session_scan_interval"` // default "10s"
CleanupAfterDays int `yaml:"cleanup_after_days"` // default 5
Concurrency int `yaml:"concurrency"` // default 2
MaxRetries int `yaml:"max_retries"` // default 5
DigestInterval string `yaml:"digest_interval"` // "" = disabled, e.g. "2h"
}
WatchConfig holds configuration for the watch daemon's workqueue behavior.
func (WatchConfig) CleanupIntervalDuration ¶
func (w WatchConfig) CleanupIntervalDuration() time.Duration
CleanupIntervalDuration returns the cleanup interval as a time.Duration, falling back to the default of 1 hour.
func (WatchConfig) DigestIntervalDuration ¶ added in v0.7.0
func (w WatchConfig) DigestIntervalDuration() (time.Duration, bool)
DigestIntervalDuration returns the digest interval duration and whether it is enabled. An empty DigestInterval string disables the digest (returns 0, false).
func (WatchConfig) DispatchIntervalDuration ¶
func (w WatchConfig) DispatchIntervalDuration() time.Duration
DispatchIntervalDuration returns the dispatch interval as a time.Duration, falling back to the default of 10 seconds.
func (WatchConfig) GetCleanupAfterDays ¶
func (w WatchConfig) GetCleanupAfterDays() int
GetCleanupAfterDays returns CleanupAfterDays with a default of 5.
func (WatchConfig) GetConcurrency ¶
func (w WatchConfig) GetConcurrency() int
GetConcurrency returns the concurrency limit with a default of 2.
func (WatchConfig) GetMaxRetries ¶
func (w WatchConfig) GetMaxRetries() int
GetMaxRetries returns the max retries with a default of 5.
func (WatchConfig) SessionScanIntervalDuration ¶ added in v0.7.0
func (w WatchConfig) SessionScanIntervalDuration() time.Duration
SessionScanIntervalDuration returns the session scan interval as a time.Duration, falling back to the default of 10 seconds.