Documentation
¶
Index ¶
- func CreateDefaultConfig(path string) (err error)
- func FindExecutablePath(executableName string, toolPlatform []string) (path string, ok bool)
- func GetDefaultConfigStr() string
- func GetOrCreateUserConfigFile(warnLog *log.Logger) (path string, created bool, err error)
- func QueryPreset(presets map[string]Preset, name string) (preset string, isShorthand bool)
- func QueryWrapper(wrappers map[string]string, toolPlatform []string, currentPlatform string) (wrapper string)
- type CompressionTool
- type Config
- func (cfg *Config) Cache()
- func (cfg *Config) GetSupportedFileExtensions() (fileExtMap map[string][]string)
- func (cfg *Config) GetSupportedFileFormats() (fileFormatsMime []string)
- func (cfg *Config) GetToolConfigFromNames(toolNames []string) (toolCfgMap map[string]*ToolConfig)
- func (cfg *Config) HasAvailableTools() bool
- func (cfg *Config) IsToolAvailable(toolName string) bool
- func (cfg *Config) QueryToolWrapper(tool *ToolConfig, platform string) string
- func (cfg *Config) Validate() []error
- type OutputMode
- type Preset
- type ToolConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultConfig ¶
func FindExecutablePath ¶
func GetDefaultConfigStr ¶
func GetDefaultConfigStr() string
func QueryPreset ¶
Types ¶
type CompressionTool ¶
type CompressionTool struct { Command string `yaml:"command"` SupportedFormats []string `yaml:"supported-formats"` Platform []string `yaml:"platform"` OutputMode OutputMode `yaml:"output-mode"` }
func (*CompressionTool) CanBatchCompress ¶
func (ct *CompressionTool) CanBatchCompress() bool
func (*CompressionTool) Overwrites ¶
func (ct *CompressionTool) Overwrites() bool
type Config ¶
type Config struct { DefaultPreset string `yaml:"default-preset"` MimeExtensions map[string][]string `yaml:"mime-extensions"` Wrappers map[string]map[string]string `yaml:"wrappers"` Presets map[string]Preset `yaml:"presets"` Tools map[string]*ToolConfig `yaml:"tools"` // contains filtered or unexported fields }
func DecodeConfigFile ¶
func (*Config) GetSupportedFileExtensions ¶
func (*Config) GetSupportedFileFormats ¶
func (*Config) GetToolConfigFromNames ¶
func (cfg *Config) GetToolConfigFromNames(toolNames []string) (toolCfgMap map[string]*ToolConfig)
func (*Config) HasAvailableTools ¶
func (*Config) IsToolAvailable ¶
func (*Config) QueryToolWrapper ¶
func (cfg *Config) QueryToolWrapper(tool *ToolConfig, platform string) string
type OutputMode ¶
type OutputMode int
const ( Unknown OutputMode = iota BatchOverwrite InputOutput Stdout )
func (OutputMode) MarshalYAML ¶
func (o OutputMode) MarshalYAML() (any, error)
func (*OutputMode) UnmarshalYAML ¶
func (o *OutputMode) UnmarshalYAML(value *yaml.Node) error
type ToolConfig ¶
type ToolConfig struct { CompressionTool `yaml:",inline"` Description string `yaml:"description"` Arguments map[string][]string `yaml:"arguments"` }
Click to show internal directories.
Click to hide internal directories.