Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotAvailable = errors.New("ripgrep: rg binary not available")
ErrNotAvailable is returned when the ripgrep binary cannot be found or executed.
Functions ¶
This section is empty.
Types ¶
type ExecFunc ¶
type ExecFunc func(ctx context.Context, name string, args []string, dir string) (stdout []byte, exitCode int, err error)
ExecFunc executes a binary by name with args in dir and returns its stdout, exit code, and any execution error.
type GlobOptions ¶
GlobOptions configures file matching options for [Glob].
type Match ¶
type Match struct {
Path string `json:"path"`
Line int `json:"line"`
Column int `json:"column"`
Content string `json:"content"`
}
Match represents a text match returned by [Search].
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes ripgrep commands through an injected ExecFunc (such as a sandbox Proc capability) and caches binary availability per Runner instance.
func (*Runner) Glob ¶
func (r *Runner) Glob(ctx context.Context, searchPath, pattern string, opts ...GlobOptions) ([]string, error)
Glob searches for files matching pattern under searchPath using ripgrep.
func (*Runner) IsAvailable ¶
IsAvailable reports whether the ripgrep (rg) binary is available via Runner's ExecFunc. If rg was not found previously, it re-checks at most once every 30 seconds.