Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRepository ¶
func AddRepository(repoConfig RepoConfig, configPath string) error
func GetConfigPath ¶ added in v0.2.0
GetConfigPath returns the config file path, using the provided path if not empty, otherwise returning the default config path
func SaveConfig ¶
Types ¶
type Config ¶
type Config struct {
Global GlobalConfig `toml:"global"`
Repositories []RepoConfig `toml:"repositories"`
}
func LoadConfig ¶
type ConfigWatcher ¶
type ConfigWatcher struct {
// contains filtered or unexported fields
}
ConfigWatcher handles live configuration file watching
func NewConfigWatcher ¶
func NewConfigWatcher(configPath string, onChange func(*Config) error, logger *slog.Logger) (*ConfigWatcher, error)
NewConfigWatcher creates a new ConfigWatcher instance
func (*ConfigWatcher) GetCurrentConfig ¶
func (cw *ConfigWatcher) GetCurrentConfig() *Config
GetCurrentConfig returns the current configuration (thread-safe)
func (*ConfigWatcher) StartWatching ¶
func (cw *ConfigWatcher) StartWatching() error
StartWatching begins watching the config file for changes
func (*ConfigWatcher) StopWatching ¶
func (cw *ConfigWatcher) StopWatching()
StopWatching stops watching the config file
type GlobalConfig ¶
type GlobalConfig struct {
LogLevel string `toml:"log_level"`
DefaultInterval int `toml:"default_interval"`
MaxConcurrentSyncs int `toml:"max_concurrent_syncs"`
// History configuration
HistoryMaxEntries int `toml:"history_max_entries"`
HistoryRetentionDays int `toml:"history_retention_days"`
HistoryCacheDir string `toml:"history_cache_dir"`
HistoryMaxFileSizeMB int `toml:"history_max_file_size_mb"`
// Notification configuration
EnableNotifications bool `toml:"enable_notifications"`
NotificationTimeout int `toml:"notification_timeout"`
}
type RepoConfig ¶
type RepoConfig struct {
Path string `toml:"path"`
Enabled bool `toml:"enabled"`
Direction string `toml:"direction"`
Interval int `toml:"interval"`
Remote string `toml:"remote"`
BranchStrategy string `toml:"branch_strategy"`
TargetBranch string `toml:"target_branch,omitempty"`
SafetyChecks bool `toml:"safety_checks"`
ForcePush bool `toml:"force_push"`
}
Click to show internal directories.
Click to hide internal directories.