process

package
v0.0.0-...-9bf69fc Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NowRFC3339Nano

func NowRFC3339Nano() string

Types

type CommandSpec

type CommandSpec struct {
	Name        string
	Args        []string
	Dir         string
	Env         map[string]string
	LogPath     string
	AppendLog   bool
	OnLine      func(stream, line string)
	Grace       time.Duration
	ReadyWait   time.Duration
	Interactive bool
	Prompts     []PromptSpec
	OnPrompt    func(PromptRequest) (PromptResponse, error)
}

type Handle

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

func Start

func Start(ctx context.Context, spec CommandSpec) (*Handle, error)

func (*Handle) Alive

func (h *Handle) Alive() bool

func (*Handle) PID

func (h *Handle) PID() int

func (*Handle) Stop

func (h *Handle) Stop() error

func (*Handle) Wait

func (h *Handle) Wait() error

func (*Handle) WriteString

func (h *Handle) WriteString(value string) error

type PromptKind

type PromptKind string
const (
	PromptConfirm PromptKind = "confirm"
	PromptText    PromptKind = "text"
)

type PromptRequest

type PromptRequest struct {
	ID     string
	Prompt string
	Kind   PromptKind
}

type PromptResponse

type PromptResponse struct {
	Value string
}

type PromptSpec

type PromptSpec struct {
	Pattern  string
	Patterns []string
	Prompt   string
	Kind     PromptKind
	Repeat   bool
}

type Result

type Result struct {
	ExitCode int
}

func Run

func Run(ctx context.Context, spec CommandSpec) (Result, error)

Jump to

Keyboard shortcuts

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