Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Launcher ¶ added in v0.2.0
type Launcher struct {
// contains filtered or unexported fields
}
Launcher struct
func New ¶
func New() *Launcher
New leakless instance
Example ¶
package main
import (
"fmt"
"time"
"github.com/ysmood/leakless"
)
func main() {
ll := leakless.New()
// just like using the exec.Command
_ = ll.Command("sleep", "3").Start()
// get the pid of the guarded sub-process
select {
case <-time.Tick(3 * time.Second):
panic("timeout")
case pid := <-ll.Pid():
fmt.Println(pid)
}
}
Output:
func (*Launcher) Command ¶ added in v0.2.0
Command will try to download the leakless bin and prefix the exec.Cmd with the leakless options.
Click to show internal directories.
Click to hide internal directories.