Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Leakless ¶
type Leakless struct {
// contains filtered or unexported fields
}
Leakless ...
func New ¶
func New() *Leakless
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 (*Leakless) Command ¶
Command will try to download the leakless bin and prefix the exec.Cmd with the leakless options. If it fails to download the bin a normal exec.Cmd will be returned.
Click to show internal directories.
Click to hide internal directories.