{"modulePath":"github.com/kernel164/gogs","version":"v0.7.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package process\n\n## Variables\n\n```go\nvar (\n\t// NOTE: could be custom in config file for default.\n\tDEFAULT = 60 * time.Second\n)\n```\nCommon timeout.\n\n```go\nvar (\n\tErrExecTimeout = errors.New(\"Process execution timeout\")\n)\n```\n\n```go\nvar (\n\tProcesses []*Process\n)\n```\nList of existing processes.\n\n## Functions\n\n```go\nfunc Add(desc string, cmd *exec.Cmd) int64\n```\nAdd adds a existing process and returns its PID.\n\n```go\nfunc Exec(desc, cmdName string, args ...string) (string, string, error)\n```\nExec starts executing a command, it records its process and has default timeout.\n\n```go\nfunc ExecDir(timeout time.Duration, dir, desc, cmdName string, args ...string) (string, string, error)\n```\nExec starts executing a command in given path, it records its process and timeout.\n\n```go\nfunc ExecTimeout(timeout time.Duration, desc, cmdName string, args ...string) (string, string, error)\n```\nExec starts executing a command, it records its process and timeout.\n\n```go\nfunc Kill(pid int64) error\n```\nKill kills and removes a process from list.\n\n```go\nfunc Remove(pid int64)\n```\nRemove removes a process from list.\n\n## Types\n\n```go\ntype Process struct {\n\tPid         int64 // Process ID, not system one.\n\tDescription string\n\tStart       time.Time\n\tCmd         *exec.Cmd\n}\n```\nProcess represents a working process inherit from Gogs.\n\n","path":"github.com/kernel164/gogs/modules/process","name":"process","synopsis":"","isRedistributable":true}
