Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
ActionType represents what to do with a file during sync
const ( ActionDownload ActionType = "download" ActionDelete ActionType = "delete" ActionSkip ActionType = "skip" ActionUpdate ActionType = "update" )
type FailedFile ¶
FailedFile records a file that failed all retries
type NameSetter ¶
type NameSetter interface {
SetName(name string)
}
NameSetter is an optional interface that providers can implement to allow their name to be overridden with the user-chosen config name.
type Provider ¶
type Provider interface {
// Name returns the provider identifier (e.g., "epel", "ocp-binaries")
Name() string
// Type returns the provider content type (e.g., "rpm_repo", "binary")
Type() string
// Configure loads provider-specific settings from the unified config
Configure(cfg ProviderConfig) error
// Plan compares upstream manifest against local state, returns
// a list of actions (download, delete, skip) without executing them
Plan(ctx context.Context) (*SyncPlan, error)
// Sync executes the plan — downloads, validates, retries
Sync(ctx context.Context, plan *SyncPlan, opts SyncOptions) (*SyncReport, error)
// Validate checks integrity of all local content against manifests
Validate(ctx context.Context) (*ValidationReport, error)
}
Provider is the core interface that all content types implement
type ProviderConfig ¶
type ProviderConfig = config.ProviderConfig
ProviderConfig is an alias for config.ProviderConfig to avoid import cycles Both packages define the same underlying type: map[string]interface{}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all registered providers
func (*Registry) RegisterAs ¶
RegisterAs adds a provider under an explicit name, overriding p.Name(). Use this when the user-chosen config name differs from the provider's built-in type name (e.g. config name "epel-10" vs provider name "epel"). If the provider implements NameSetter, its internal name is also updated so that logs and reports use the config name consistently.
type SyncAction ¶
type SyncAction struct {
Path string // relative path within provider output dir (used as DB key)
LocalPath string // absolute filesystem path for downloads
Action ActionType
Size int64
Checksum string // expected SHA256
Reason string // human-readable reason (e.g. "new file", "checksum mismatch")
URL string // download URL (for download/update actions)
Headers map[string]string // optional HTTP headers required for URL fetch (e.g. Authorization)
}
SyncAction represents a single file operation in a sync plan
type SyncOptions ¶
type SyncOptions struct {
DryRun bool
Force bool // re-download everything regardless of checksum
MaxWorkers int
RetryCount int
}
SyncOptions controls how Sync() executes
type SyncPlan ¶
type SyncPlan struct {
Provider string
Actions []SyncAction
TotalSize int64 // bytes to download
TotalFiles int
Timestamp time.Time
}
SyncPlan is the output of Plan() — what will change without executing
type SyncReport ¶
type SyncReport struct {
Provider string
StartTime time.Time
EndTime time.Time
Downloaded int
Deleted int
Skipped int
Failed []FailedFile
BytesTransferred int64
}
SyncReport is the result of Sync()
type ValidationProgressFn ¶
ValidationProgressFn is called during validation for each file checked. checked is the count so far, total is the expected total, path is the current file, valid indicates whether it passed validation.
type ValidationProgressSetter ¶
type ValidationProgressSetter interface {
SetValidationProgress(fn ValidationProgressFn)
}
ValidationProgressSetter is an optional interface that providers can implement to report per-file progress during validation.
type ValidationReport ¶
type ValidationReport struct {
Provider string
TotalFiles int
ValidFiles int
InvalidFiles []ValidationResult
Timestamp time.Time
}
ValidationReport is the result of Validate()