Documentation
¶
Index ¶
- Constants
- func BuildEnv(base []string, projectEnv map[string]string, runInfo *run.Info) []string
- func ExecHandoff(path string, argv []string, env []string) error
- func GetEnv(env []string, key string) (string, bool)
- func ResolvePath(path string) string
- func Run(ctx context.Context, root string, name string, enabled EnabledSelector, ...) error
- func RunNoSync(root string, name string, enabled EnabledSelector, launch LaunchFunc, ...) error
- func RunNoSyncWithStderr(root string, name string, enabled EnabledSelector, launch LaunchFunc, ...) error
- func RunWithStderr(ctx context.Context, root string, name string, enabled EnabledSelector, ...) error
- func SamePath(a, b string) bool
- func SetEnv(env []string, key string, value string) []string
- func UnsetEnv(env []string, key string) []string
- type EnabledSelector
- type LaunchFunc
Constants ¶
const (
// EnvDispatchActive blocks nested Agent Dispatch calls inside dispatched children.
EnvDispatchActive = "AL_DISPATCH_ACTIVE"
)
Variables ¶
This section is empty.
Functions ¶
func BuildEnv ¶
BuildEnv merges base env with project env and run metadata. It strips AL_SHIM_ACTIVE because child processes are new execution contexts that should be free to dispatch independently; the dispatch guard is only meaningful for the exec replacement chain. It also strips AL_DISPATCH_ACTIVE so a leaked marker from the parent shell does not poison normal (non-dispatch) launches; the dispatch flow re-sets the marker explicitly on the dispatched child.
func ExecHandoff ¶ added in v0.12.1
ExecHandoff replaces the current al process with the target binary. On success it never returns. argv[0] must be the program name.
func ResolvePath ¶ added in v0.8.5
ResolvePath returns the absolute, symlink-resolved form of a path. If resolution fails at any step, it returns the best result available.
func Run ¶
func Run(ctx context.Context, root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string, currentVersion string) error
Run performs the standard client launch pipeline: load config, sync, create run dir, launch. Warnings from sync are printed to stderr before launching.
func RunNoSync ¶ added in v0.5.8
func RunNoSync(root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string) error
RunNoSync performs the standard client launch pipeline without running sync.
func RunNoSyncWithStderr ¶ added in v0.8.1
func RunNoSyncWithStderr(root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string, stderr io.Writer) error
RunNoSyncWithStderr is like RunNoSync but allows specifying a custom stderr writer for testing.
func RunWithStderr ¶
func RunWithStderr(ctx context.Context, root string, name string, enabled EnabledSelector, launch LaunchFunc, quiet bool, args []string, currentVersion string, stderr io.Writer) error
RunWithStderr is like Run but allows specifying a custom stderr writer for testing.
func SamePath ¶ added in v0.8.5
SamePath returns true if two paths resolve to the same filesystem location, accounting for symlinks and relative paths.
Types ¶
type EnabledSelector ¶
EnabledSelector returns the enabled flag for a client.
type LaunchFunc ¶
type LaunchFunc func(project *config.ProjectConfig, runInfo *run.Info, env []string, args []string) error
LaunchFunc launches a client after sync and run setup.