Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLeaklessBin ¶
func GetLeaklessBin() string
GetLeaklessBin returns the executable path of the guard, if it doesn't exists create one.
Types ¶
type Launcher ¶
type Launcher struct {
// Lock for leakless.LockPort, default is 2978
Lock int
// 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)
}
}
Click to show internal directories.
Click to hide internal directories.