runner

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package runner handles the execution of tool operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultRunner

type DefaultRunner struct {
	// contains filtered or unexported fields
}

DefaultRunner is the default implementation of the Runner interface.

func NewDefaultRunner

func NewDefaultRunner(cache *cache.Cache, log *logger.Logger) *DefaultRunner

NewDefaultRunner creates a new DefaultRunner instance.

func (*DefaultRunner) Run

func (r *DefaultRunner) Run(ctx context.Context, t *tool.Tool, tags tags.IncludeTags, options ...RunOption) Result

Run executes a tool operation and returns the result.

type Result

type Result struct {
	Error    error
	Tool     *tool.Tool
	Metadata map[string]any
	Message  string
	Status   Status
}

Result represents the outcome of a tool operation.

type RunOption

type RunOption func(*runOptions)

RunOption configures how a tool operation is executed.

func WithNoDownload

func WithNoDownload() RunOption

WithNoDownload skips the download phase.

func WithProgressTracker

func WithProgressTracker(tracker getter.ProgressTracker) RunOption

WithProgressTracker sets the progress tracker for downloads.

func WithResolveOptions

func WithResolveOptions(resolveOpts ...tool.ResolveOption) RunOption

WithResolveOptions passes options to the tool's Resolve method.

type Runner

type Runner interface {
	// Run executes a tool operation and returns the result.
	Run(ctx context.Context, tool *tool.Tool, tags tags.IncludeTags, options ...RunOption) Result
}

Runner defines the interface for executing tool operations.

type Status

type Status int

Status represents the possible states of a tool operation.

const (
	// StatusOK indicates a successful operation.
	StatusOK Status = iota
	// StatusSkipped indicates the operation was skipped.
	StatusSkipped
	// StatusFailed indicates the operation failed.
	StatusFailed
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL