proc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package proc manages external plugin processes: spawn, readiness, log pumping, and lifecycle. Platform behavior lives in sys_linux.go, sys_darwin.go, and sys_windows.go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Bin        string
	Role       contract.Role
	Token      string
	ConfigPath string
	PluginDir  string
	WorkDir    string
	Logger     *slog.Logger
}

type Process

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

func Spawn

func Spawn(ctx context.Context, cfg Config) (*Process, error)

func (*Process) Addr

func (p *Process) Addr() string

func (*Process) ExitCode

func (p *Process) ExitCode() int

func (*Process) Exited

func (p *Process) Exited() <-chan struct{}

Exited returns a channel that is closed when the process exits.

func (*Process) Kill

func (p *Process) Kill() error

func (*Process) ReadyInfo

func (p *Process) ReadyInfo() Ready

func (*Process) Stop

func (p *Process) Stop() error

func (*Process) Terminate

func (p *Process) Terminate() error

func (*Process) Wait

func (p *Process) Wait() error

type Ready

type Ready struct {
	Ready           bool `json:"ready"`
	ProtocolVersion int  `json:"protocolVersion"`
	PID             int  `json:"pid,omitempty"`
	Port            int  `json:"port,omitempty"` // contract: integer, TCP mode only
}

Jump to

Keyboard shortcuts

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