Documentation
¶
Index ¶
- type CommandRunner
- func (r *CommandRunner) Check(ctx context.Context) error
- func (r *CommandRunner) Run(ctx context.Context, args ...string) ([]byte, []byte, error)
- func (r *CommandRunner) RunWithInput(ctx context.Context, input []byte, args ...string) ([]byte, []byte, error)
- func (r *CommandRunner) ToolName() string
- func (r *CommandRunner) ToolPath() string
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandRunner ¶
type CommandRunner struct {
// contains filtered or unexported fields
}
CommandRunner implements the Runner interface using os/exec.
func (*CommandRunner) Check ¶
func (r *CommandRunner) Check(ctx context.Context) error
Check verifies the tool exists and is executable.
func (*CommandRunner) RunWithInput ¶
func (r *CommandRunner) RunWithInput(ctx context.Context, input []byte, args ...string) ([]byte, []byte, error)
RunWithInput executes the tool with stdin input.
func (*CommandRunner) ToolName ¶
func (r *CommandRunner) ToolName() string
ToolName returns the name of the tool.
func (*CommandRunner) ToolPath ¶
func (r *CommandRunner) ToolPath() string
ToolPath returns the path to the tool.
type Runner ¶
type Runner interface {
// Check verifies the tool exists and is executable.
Check(ctx context.Context) error
// Run executes the tool with given arguments.
Run(ctx context.Context, args ...string) (stdout []byte, stderr []byte, err error)
// RunWithInput executes the tool with stdin input.
RunWithInput(ctx context.Context, input []byte, args ...string) (stdout []byte, stderr []byte, err error)
// ToolName returns the name of the tool (e.g., "magika", "exiftool").
ToolName() string
// ToolPath returns the configured path to the tool.
ToolPath() string
}
Runner defines an interface for executing external command-line tools.
func NewExiftoolRunner ¶
NewExiftoolRunner creates a new Runner for the ExifTool tool.
func NewFileRunner ¶
NewFileRunner creates a new Runner for the file command.
func NewJdupesRunner ¶
NewJdupesRunner creates a new Runner for the jdupes tool.
func NewMagikaRunner ¶
NewMagikaRunner creates a new Runner for the Magika tool.
Click to show internal directories.
Click to hide internal directories.