config

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDirs

func EnsureDirs() error

EnsureDirs creates required zen directories.

func StateDir

func StateDir() string

StateDir returns the path to the zen state directory.

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"`
	Watch        WatchConfig           `yaml:"watch"`
}

Config holds the complete zen configuration.

func Load

func Load() (*Config, error)

Load reads the YAML config from ~/.zen/config.yaml. Returns an error if the config file does not exist or is invalid.

func (*Config) IsAuthor

func (c *Config) IsAuthor(login string) bool

IsAuthor returns true if the given login is in the authors list.

func (*Config) RepoBasePath

func (c *Config) RepoBasePath(short string) string

RepoBasePath returns the local base path for a repo (the parent dir that contains the main clone directory).

func (*Config) RepoFullName

func (c *Config) RepoFullName(short string) string

RepoFullName maps a short name to full GitHub owner/repo.

func (*Config) RepoNames

func (c *Config) RepoNames() []string

RepoNames returns all configured short repo names.

func (*Config) RepoShortName

func (c *Config) RepoShortName(full string) string

RepoShortName maps a full GitHub owner/repo to short name.

type RepoConfig

type RepoConfig struct {
	FullName string `yaml:"full_name"`
	BasePath string `yaml:"base_path"`
}

RepoConfig holds per-repository configuration.

type WatchConfig

type WatchConfig struct {
	DispatchInterval string `yaml:"dispatch_interval"`  // default "10s"
	CleanupInterval  string `yaml:"cleanup_interval"`   // default "1h"
	CleanupAfterDays int    `yaml:"cleanup_after_days"` // default 5
	Concurrency      int    `yaml:"concurrency"`        // default 2
	MaxRetries       int    `yaml:"max_retries"`        // default 5
}

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) 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL