MCPcopy Index your code
hub / github.com/coder/envbox / New

Function New

background/process.go:38–49  ·  view source on GitHub ↗

New returns an instantiated daemon.

(ctx context.Context, log slog.Logger, cmd string, args ...string)

Source from the content-addressed store, hash-verified

36
37// New returns an instantiated daemon.
38func New(ctx context.Context, log slog.Logger, cmd string, args ...string) *Process {
39 ctx, cancel := context.WithCancel(ctx)
40 return &Process{
41 ctx: ctx,
42 cancel: cancel,
43 waitCh: make(chan error, 1),
44 cmd: xunix.GetExecer(ctx).CommandContext(ctx, cmd, args...),
45 log: log.Named(cmd),
46 userKilled: i64ptr(0),
47 binName: cmd,
48 }
49}
50
51// Start starts the daemon. It functions akin to ox/exec.Command.Start().
52func (d *Process) Start() error {

Callers 1

dockerCmdFunction · 0.92

Calls 3

GetExecerFunction · 0.92
i64ptrFunction · 0.85
CommandContextMethod · 0.65

Tested by

no test coverage detected