Documentation ¶
Index ¶
- Variables
- func Command(timeout time.Duration, name string, arg ...string) ([]byte, error)
- func DumpHeap()
- func ExecuteTemplate(tpl string, data interface{}, post_process func(string) string) (string, error)
- func FindAllTemplateKeys(tpl string) (res []string)
- func GC()
- func HttpPprofServe(port int)
- func IsAlNum(s string) bool
- func IsDigit(s string) bool
- func IsDirectory(path string) (bool, error)
- func MustPositiveInterval(interval string, dft time.Duration) time.Duration
- func PathExists(path string) (bool, error)
- func PrintGCSummary()
- func ReadCommand(line func(string) error, name string, arg ...string) error
- func ReadCommandTimeout(timeout time.Duration, line func(string) error, name string, arg ...string) error
- func ReadLine(fname string, line func(string) error) error
- func Recover_and_log()
- func SetMemProfileRate(rate int)
- func ShowGCStat()
- func StartBlockProfile(rate int)
- func StartCPUProfile()
- func StopBlockProfile()
- func StopCPUProfile()
- type SMA
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPath is returned by Command if the program is not in the PATH. ErrPath = errors.New("program not in PATH") // ErrTimeout is returned by Command if the program timed out. ErrTimeout = errors.New("program killed after timeout") )
Functions ¶
func Command ¶ added in v0.2.0
Command executes the named program with the given arguments. If it does not exit within timeout, it is sent SIGINT (if supported by Go). After another timeout, it is killed.
func ExecuteTemplate ¶
func ExecuteTemplate(tpl string, data interface{}, post_process func(string) string) (string, error)
FIXME: leaking param: data
func FindAllTemplateKeys ¶
func HttpPprofServe ¶
func HttpPprofServe(port int)
func IsDirectory ¶ added in v0.2.0
func MustPositiveInterval ¶ added in v0.2.0
FIXME: dft should also > 0
func PathExists ¶
exists returns whether the given file or directory exists or not
func PrintGCSummary ¶ added in v0.2.0
func PrintGCSummary()
func ReadCommand ¶ added in v0.2.0
ReadCommand runs command name with args and calls line for each line from its stdout. Command is interrupted (if supported by Go) after 10 seconds and killed after 20 seconds.
func ReadCommandTimeout ¶ added in v0.2.0
func ReadCommandTimeout(timeout time.Duration, line func(string) error, name string, arg ...string) error
ReadCommandTimeout is the same as ReadCommand with a specifiable timeout.
func Recover_and_log ¶ added in v0.2.0
func Recover_and_log()
func SetMemProfileRate ¶ added in v0.2.0
func SetMemProfileRate(rate int)
func ShowGCStat ¶ added in v0.2.0
func ShowGCStat()
func StartBlockProfile ¶ added in v0.2.0
func StartBlockProfile(rate int)
func StartCPUProfile ¶ added in v0.2.0
func StartCPUProfile()
func StopBlockProfile ¶ added in v0.2.0
func StopBlockProfile()
func StopCPUProfile ¶ added in v0.2.0
func StopCPUProfile()
Types ¶
Click to show internal directories.
Click to hide internal directories.