Documentation
¶
Index ¶
- type FailedFileRecord
- type FileRecord
- type Job
- type ProviderConfig
- type Store
- func (s *Store) AddFailedFile(rec *FailedFileRecord) error
- func (s *Store) Close() error
- func (s *Store) CountFileRecords(provider string) (int, error)
- func (s *Store) CountProviderConfigs() (int, error)
- func (s *Store) CreateJob(job *Job) error
- func (s *Store) CreateProviderConfig(pc *ProviderConfig) error
- func (s *Store) CreateSyncRun(run *SyncRun) error
- func (s *Store) CreateTransfer(t *Transfer) error
- func (s *Store) CreateTransferArchive(a *TransferArchive) error
- func (s *Store) DeleteFileRecord(provider, path string) error
- func (s *Store) DeleteProviderConfig(name string) error
- func (s *Store) GetFileRecord(provider, path string) (*FileRecord, error)
- func (s *Store) GetProviderConfig(name string) (*ProviderConfig, error)
- func (s *Store) GetSyncRun(id int64) (*SyncRun, error)
- func (s *Store) IncrementFailedRetry(id int64) error
- func (s *Store) IsArchiveValidated(path, archiveName, sha256 string) (bool, error)
- func (s *Store) ListFailedFiles(provider string) ([]FailedFileRecord, error)
- func (s *Store) ListFileRecords(provider string) ([]FileRecord, error)
- func (s *Store) ListJobs(status string, limit int) ([]Job, error)
- func (s *Store) ListProviderConfigs() ([]ProviderConfig, error)
- func (s *Store) ListSyncRuns(provider string, limit int) ([]SyncRun, error)
- func (s *Store) ListTransferArchives(transferID int64) ([]TransferArchive, error)
- func (s *Store) ListTransfers(limit int) ([]Transfer, error)
- func (s *Store) MarkArchiveValidated(id int64) error
- func (s *Store) ResolveFailedFile(id int64) error
- func (s *Store) SeedProviderConfigs(yamlProviders map[string]map[string]interface{}) error
- func (s *Store) SumFileSize(provider string) (int64, error)
- func (s *Store) ToggleProviderConfig(name string) error
- func (s *Store) UpdateJob(job *Job) error
- func (s *Store) UpdateProviderConfig(pc *ProviderConfig) error
- func (s *Store) UpdateSyncRun(run *SyncRun) error
- func (s *Store) UpdateTransfer(t *Transfer) error
- func (s *Store) UpsertFileRecord(rec *FileRecord) error
- type SyncRun
- type Transfer
- type TransferArchive
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FailedFileRecord ¶
type FailedFileRecord struct {
ID int64
Provider string
FilePath string
URL string
DestPath string // absolute local filesystem path for downloads
ExpectedChecksum string
ExpectedSize int64
Error string
RetryCount int
FirstFailure time.Time
LastFailure time.Time
Resolved bool
}
FailedFileRecord is a dead letter queue entry
type FileRecord ¶
type FileRecord struct {
ID int64
Provider string
Path string // relative to provider output dir
Size int64
SHA256 string
LastModified time.Time
LastVerified time.Time
SyncRunID int64
}
FileRecord tracks a downloaded file
type Job ¶
type Job struct {
ID int64
Type string // "sync", "validate", "export", "import"
Provider string // empty for "all providers" jobs
CronExpr string // for scheduled jobs
Status string // "scheduled", "running", "completed", "failed"
LastRun time.Time
NextRun time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
Job represents a scheduled or completed job
type ProviderConfig ¶
type ProviderConfig struct {
ID int64
Name string
Type string // "epel", "ocp_binaries", "ocp_clients", "rhcos", "container_images", "registry", "custom_files"
Enabled bool
ConfigJSON string
CreatedAt time.Time
UpdatedAt time.Time
}
ProviderConfig stores a provider's configuration in the database.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides SQLite-backed persistence
func (*Store) AddFailedFile ¶
func (s *Store) AddFailedFile(rec *FailedFileRecord) error
AddFailedFile adds a new FailedFileRecord
func (*Store) CountFileRecords ¶
CountFileRecords returns the count of FileRecords for a provider
func (*Store) CountProviderConfigs ¶
CountProviderConfigs returns the number of provider configs.
func (*Store) CreateProviderConfig ¶
func (s *Store) CreateProviderConfig(pc *ProviderConfig) error
CreateProviderConfig inserts a new ProviderConfig and sets its ID.
func (*Store) CreateSyncRun ¶
CreateSyncRun inserts a new SyncRun and sets its ID
func (*Store) CreateTransfer ¶
CreateTransfer inserts a new Transfer and sets its ID
func (*Store) CreateTransferArchive ¶
func (s *Store) CreateTransferArchive(a *TransferArchive) error
CreateTransferArchive inserts a new TransferArchive and sets its ID
func (*Store) DeleteFileRecord ¶
DeleteFileRecord deletes a FileRecord by provider and path
func (*Store) DeleteProviderConfig ¶
DeleteProviderConfig deletes a ProviderConfig by name.
func (*Store) GetFileRecord ¶
func (s *Store) GetFileRecord(provider, path string) (*FileRecord, error)
GetFileRecord retrieves a FileRecord by provider and path
func (*Store) GetProviderConfig ¶
func (s *Store) GetProviderConfig(name string) (*ProviderConfig, error)
GetProviderConfig retrieves a ProviderConfig by name.
func (*Store) GetSyncRun ¶
GetSyncRun retrieves a SyncRun by ID
func (*Store) IncrementFailedRetry ¶
IncrementFailedRetry increments the retry count and updates last_failure
func (*Store) IsArchiveValidated ¶
IsArchiveValidated checks whether an archive with the given path, name, and sha256 has been previously validated in a completed transfer.
func (*Store) ListFailedFiles ¶
func (s *Store) ListFailedFiles(provider string) ([]FailedFileRecord, error)
ListFailedFiles retrieves all FailedFileRecords for a provider
func (*Store) ListFileRecords ¶
func (s *Store) ListFileRecords(provider string) ([]FileRecord, error)
ListFileRecords retrieves all FileRecords for a provider
func (*Store) ListProviderConfigs ¶
func (s *Store) ListProviderConfigs() ([]ProviderConfig, error)
ListProviderConfigs retrieves all ProviderConfigs ordered by name.
func (*Store) ListSyncRuns ¶
ListSyncRuns retrieves SyncRuns, optionally filtered by provider
func (*Store) ListTransferArchives ¶
func (s *Store) ListTransferArchives(transferID int64) ([]TransferArchive, error)
ListTransferArchives retrieves all archives for a transfer
func (*Store) ListTransfers ¶
ListTransfers retrieves Transfers, optionally limited
func (*Store) MarkArchiveValidated ¶
MarkArchiveValidated marks a TransferArchive as validated
func (*Store) ResolveFailedFile ¶
ResolveFailedFile marks a FailedFileRecord as resolved
func (*Store) SeedProviderConfigs ¶
SeedProviderConfigs populates provider_configs from a YAML providers map. This is a no-op if the table already has rows.
func (*Store) SumFileSize ¶
SumFileSize returns the total size of all files for a provider
func (*Store) ToggleProviderConfig ¶
ToggleProviderConfig flips the enabled state of a provider.
func (*Store) UpdateProviderConfig ¶
func (s *Store) UpdateProviderConfig(pc *ProviderConfig) error
UpdateProviderConfig updates an existing ProviderConfig by ID.
func (*Store) UpdateSyncRun ¶
UpdateSyncRun updates an existing SyncRun by ID
func (*Store) UpdateTransfer ¶
UpdateTransfer updates an existing Transfer by ID
func (*Store) UpsertFileRecord ¶
func (s *Store) UpsertFileRecord(rec *FileRecord) error
UpsertFileRecord inserts or replaces a FileRecord
type SyncRun ¶
type SyncRun struct {
ID int64
Provider string
StartTime time.Time
EndTime time.Time
FilesDownloaded int
FilesDeleted int
FilesSkipped int
FilesFailed int
BytesTransferred int64
Status string // "success", "partial", "failed"
ErrorMessage string
}
SyncRun records a sync execution
type Transfer ¶
type Transfer struct {
ID int64
Direction string // "export" or "import"
Path string // source/destination path
Providers string // comma-separated provider names
ArchiveCount int
TotalSize int64
ManifestHash string
Status string // "running", "completed", "failed"
ErrorMessage string
StartTime time.Time
EndTime time.Time
}
Transfer records an export or import operation