Documentation
¶
Overview ¶
Package fetch implements the fetch command functionality
Package fetch exposes the distribution fetch flow to the app layer.
Index ¶
- type CommandHandler
- type CommandHandlerOptions
- type Error
- func NewConfigLoadError(err error) *Error
- func NewConfigLoadErrorMsg(msg string) *Error
- func NewFilterNoMatchError(message string) *Error
- func NewOutputDirError(err error) *Error
- func NewProviderInitError(err error) *Error
- func NewProviderInitErrorMsg(msg string) *Error
- func NewRemotesLoadError(err error) *Error
- func NewRepoDownloadError(err error) *Error
- func NewRepoDownloadErrorMsg(msg string) *Error
- func NewWorkingDirError(err error) *Error
- type ErrorType
- type ExecutionSummary
- type Handler
- type HandlerOptions
- type ProgressTracker
- type Request
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler struct {
// contains filtered or unexported fields
}
CommandHandler manages the fetch command operations
func NewCommandHandler ¶
func NewCommandHandler(opts *CommandHandlerOptions) (*CommandHandler, error)
NewCommandHandler creates a new fetch command handler with the provided options.
func (*CommandHandler) Execute ¶
func (h *CommandHandler) Execute(ctx context.Context) error
Execute runs the fetch command to download and filter repositories
func (*CommandHandler) ExecutionSummary ¶
func (h *CommandHandler) ExecutionSummary() ExecutionSummary
ExecutionSummary returns counts from the last fetch execution.
type CommandHandlerOptions ¶
type CommandHandlerOptions struct {
Token string
BaseURL string
DistributionName string
OutputDir string // if empty, use cache path with timestamp
Files []string
WorkersOverride int
RateLimitOverride float64
TaskTimeoutOverride time.Duration
WorkersSet bool
RateLimitSet bool
TaskTimeoutSet bool
DryRun bool
UseCache bool // default true
UUIDFilter []string
UserFilter []string
// WorkingDir optionally overrides project root detection.
WorkingDir string
}
CommandHandlerOptions contains options for the fetch command handler.
type Error ¶
type Error = apperror.CommandError[ErrorType]
Error is a type alias for the generic CommandError.
func NewConfigLoadError ¶
NewConfigLoadError creates a new Error for configuration loading failures.
func NewConfigLoadErrorMsg ¶
NewConfigLoadErrorMsg creates a config-load error with a direct message (no wrapped error).
func NewFilterNoMatchError ¶
NewFilterNoMatchError creates a new Error when no repositories match the filter criteria.
func NewOutputDirError ¶
NewOutputDirError creates a new Error for output directory resolution failures.
func NewProviderInitError ¶
NewProviderInitError creates a new Error for provider initialization failures.
func NewProviderInitErrorMsg ¶
NewProviderInitErrorMsg creates a provider-init error with a direct message (no wrapped error).
func NewRemotesLoadError ¶
NewRemotesLoadError creates a new Error for remotes loading failures.
func NewRepoDownloadError ¶
NewRepoDownloadError creates a new Error for repository download failures.
func NewRepoDownloadErrorMsg ¶
NewRepoDownloadErrorMsg creates a repository-download error with a direct message.
func NewWorkingDirError ¶
NewWorkingDirError creates a new Error for working directory determination failures.
type ErrorType ¶
type ErrorType int
ErrorType defines error categories for the fetch command.
const ( // ErrConfigLoad indicates a configuration loading error ErrConfigLoad ErrorType = iota // ErrProviderInit indicates provider initialization errors ErrProviderInit // ErrRemotesLoad indicates remotes loading errors ErrRemotesLoad // ErrRepoDownload indicates repository download errors ErrRepoDownload // ErrFilterNoMatch indicates no repositories matched the filter ErrFilterNoMatch // ErrWorkingDir indicates working directory errors ErrWorkingDir // ErrOutputDir indicates output directory errors ErrOutputDir )
type ExecutionSummary ¶
ExecutionSummary reports completed fetch work.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler orchestrates the fetch flow.
func NewHandler ¶
func NewHandler(opts *HandlerOptions) *Handler
NewHandler constructs a fetch handler with default dependencies.
type HandlerOptions ¶
type HandlerOptions struct {
NewInternalHandler newInternalHandlerFunc
}
HandlerOptions configures how the fetch handler creates its internal command handler.
type ProgressTracker ¶
type ProgressTracker struct {
// contains filtered or unexported fields
}
ProgressTracker manages progress reporting for fetch operations
func NewProgressTracker ¶
func NewProgressTracker(total int) *ProgressTracker
NewProgressTracker creates a new progress tracker for fetch operations
func (*ProgressTracker) ReportProgress ¶
func (f *ProgressTracker) ReportProgress(_ string)
ReportProgress updates the progress by incrementing the completed count
func (*ProgressTracker) Stop ¶
func (f *ProgressTracker) Stop()
Stop terminates the progress tracker and cleans up the display
type Request ¶
type Request struct {
Token string
BaseURL string
DistributionName string
OutputDir string
Files []string
WorkersOverride int
RateLimitOverride float64
TaskTimeoutOverride time.Duration
WorkersSet bool
RateLimitSet bool
TaskTimeoutSet bool
DryRun bool
UseCache bool
UUIDFilter []string
UserFilter []string
WorkingDir string
}
Request contains the input and overrides used for a fetch run.