Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLeaklessBin ¶ added in v0.6.2
func GetLeaklessBin() string
GetLeaklessBin returns the executable path of the guard. Usually you use it to prevent race condition of the file creation of the guard bin.
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.