Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitOperations ¶
type GitOperations struct {
// contains filtered or unexported fields
}
func NewGitOperations ¶
func NewGitOperations(logger *slog.Logger) *GitOperations
func (*GitOperations) SyncRepository ¶
func (g *GitOperations) SyncRepository(repo configPkg.RepoConfig) error
SyncRepository performs the sync operation using go-git library
type HistoryManager ¶
type HistoryManager struct {
// contains filtered or unexported fields
}
HistoryManager manages persistent sync history using JSON Lines format
func NewHistoryManager ¶
func NewHistoryManager(cacheDir string, maxEntries, retentionDays, maxFileSizeMB int, logger *slog.Logger) (*HistoryManager, error)
NewHistoryManager creates a new history manager
func (*HistoryManager) CleanOldEntries ¶
func (hm *HistoryManager) CleanOldEntries() error
CleanOldEntries removes entries older than the retention period
func (*HistoryManager) GetHistory ¶
func (hm *HistoryManager) GetHistory(limit int, repoFilter string, failedOnly bool) ([]SyncHistoryEntry, error)
GetHistory retrieves sync history entries with optional filtering
func (*HistoryManager) RecordSync ¶
func (hm *HistoryManager) RecordSync(repoPath, direction, status string, duration time.Duration, errorMsg string)
RecordSync records a sync operation to the history file
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶
func NewScheduler(logger *slog.Logger, historyManager *HistoryManager) *Scheduler
func (*Scheduler) GetStatus ¶
func (s *Scheduler) GetStatus() map[string]SchedulerStatus
GetStatus returns the current status of all scheduled repositories
func (*Scheduler) Start ¶
func (s *Scheduler) Start(ctx context.Context, repos []config.RepoConfig, sm *SyncManager)
type SyncHistoryEntry ¶
type SyncHistoryEntry struct {
Timestamp time.Time `json:"timestamp"`
RepoPath string `json:"repo_path"`
Direction string `json:"direction"`
Status string `json:"status"`
DurationMs int64 `json:"duration_ms"`
ErrorMsg string `json:"error_message,omitempty"`
}
SyncHistoryEntry represents a single sync operation record
type SyncManager ¶
type SyncManager struct {
// contains filtered or unexported fields
}
func NewSyncManager ¶
func NewSyncManager(maxConcurrent int, logger *slog.Logger) *SyncManager
func (*SyncManager) SyncRepository ¶
func (sm *SyncManager) SyncRepository(repo config.RepoConfig) error
Click to show internal directories.
Click to hide internal directories.