Documentation
¶
Index ¶
- func BackendKey(input domain.Format, output domain.Format) string
- type CommandStatus
- type ConvertRequest
- type DependencyStatus
- type InteractiveRequest
- type JobReport
- type PairPreference
- type Preferences
- func (p Preferences) OptionsFor(input domain.Format, output domain.Format) domain.ToolOptions
- func (p Preferences) OrderConverters(input domain.Format, output domain.Format, converters []ports.Converter) []ports.Converter
- func (p Preferences) PreferredConverter(input domain.Format, output domain.Format, available []ports.Converter) ports.Converter
- type ReportStatus
- type RunReport
- type Service
- func (s *Service) BuildJobs(req ConvertRequest) ([]domain.ConvertJob, error)
- func (s *Service) Convert(ctx context.Context, req ConvertRequest) (RunReport, error)
- func (s *Service) Converters() []ports.Converter
- func (s *Service) DependencyStatus() []DependencyStatus
- func (s *Service) Interactive(ctx context.Context, req InteractiveRequest) (RunReport, error)
- func (s *Service) OutputFormatChoicesForInputs(inputs []string, inputOverride domain.Format, ...) ([]ports.FormatChoice, error)
- func (s *Service) OutputFormatsForInputs(inputs []string, inputOverride domain.Format) ([]domain.Format, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandStatus ¶
type CommandStatus struct {
Name string
Found bool
Hints []ports.InstallSuggestion
}
type ConvertRequest ¶
type DependencyStatus ¶
type DependencyStatus struct {
Backend string
Description string
Commands []CommandStatus
}
type InteractiveRequest ¶
type PairPreference ¶
type Preferences ¶
type Preferences struct {
Pairs []PairPreference
ToolOptions domain.ToolOptions
// Backends maps "input->output" pair keys or bare "input" format keys
// to ordered preferred backend IDs. When a preferred backend is
// installed, it is used without asking.
Backends map[string][]string
}
func (Preferences) OptionsFor ¶
func (p Preferences) OptionsFor(input domain.Format, output domain.Format) domain.ToolOptions
func (Preferences) OrderConverters ¶
func (Preferences) PreferredConverter ¶
func (p Preferences) PreferredConverter(input domain.Format, output domain.Format, available []ports.Converter) ports.Converter
PreferredConverter returns the first installed converter matching a configured backend preference for this pair, or nil when none is set.
type ReportStatus ¶
type ReportStatus string
const ( StatusConverted ReportStatus = "converted" StatusSkipped ReportStatus = "skipped" StatusFailed ReportStatus = "failed" )
type RunReport ¶
type RunReport struct {
Items []JobReport
}
func (RunReport) Count ¶
func (r RunReport) Count(status ReportStatus) int
func (RunReport) HasFailures ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(converters []ports.Converter, discovery ports.FileDiscovery, fs ports.FileSystem, prompt ports.Prompt, runner ports.CommandRunner, advisor ports.InstallAdvisor, preferences Preferences, progress ports.ProgressReporter) *Service
func (*Service) BuildJobs ¶
func (s *Service) BuildJobs(req ConvertRequest) ([]domain.ConvertJob, error)
func (*Service) Converters ¶
func (*Service) DependencyStatus ¶
func (s *Service) DependencyStatus() []DependencyStatus
func (*Service) Interactive ¶
func (*Service) OutputFormatChoicesForInputs ¶
func (s *Service) OutputFormatChoicesForInputs(inputs []string, inputOverride domain.Format, requestOptions domain.ToolOptions) ([]ports.FormatChoice, error)
Click to show internal directories.
Click to hide internal directories.