gitexec

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingDeadline = errors.New("gitexec: missing deadline")

ErrMissingDeadline is returned when Run is called with a context that has no deadline.

Functions

This section is empty.

Types

type Exec

type Exec interface {
	LookPath(name string) (string, error)
	Run(ctx context.Context, name string, args ...string) ([]byte, error)
	RunJSON(ctx context.Context, name string, args ...string) ([]byte, error)
}

Exec is the injectable CLI surface used by forge and local git callers.

type Runner

type Runner struct {
	Timeout time.Duration
	// contains filtered or unexported fields
}

Runner executes external CLIs with a timeout and failsafe-go resilience.

func New

func New() *Runner

New returns a runner with a sensible default timeout.

func (*Runner) LookPath

func (r *Runner) LookPath(name string) (string, error)

LookPath reports whether name is on PATH.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, name string, args ...string) ([]byte, error)

Run executes a command and returns stdout bytes. Requires ctx to have a deadline (fail closed).

func (*Runner) RunJSON

func (r *Runner) RunJSON(ctx context.Context, name string, args ...string) ([]byte, error)

RunJSON runs argv and expects JSON on stdout.

Jump to

Keyboard shortcuts

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