Documentation ¶
Overview ¶
package telex executes process and streams process output to clients
Index ¶
- Constants
- func GetOutputStream(cache *JobCache, ctx context.Context, handle string, streamType int) (<-chan string, error)
- func Kill(cache *JobCache, handle string) error
- func StartProcess(cache *JobCache, cmdLine string, user string, mountPoint ...string) (string, error)
- func Status(cache *JobCache, handle string) (status int, owner string, exitcode int, err error)
- type JobCache
Constants ¶
View Source
const ( StatusInvalid = iota StatusRunning StatusCompleted StatusFailed StatusKilled )
Process status codes
View Source
const ( StreamStdout StreamStderr )
Output stream types
Variables ¶
This section is empty.
Functions ¶
func GetOutputStream ¶
func GetOutputStream(cache *JobCache, ctx context.Context, handle string, streamType int) (<-chan string, error)
GetOutputStream returns channel the client can read process output from. The channel will be closed when all output of the process is delivered. Client can cancel the stream using context. It is a responsibility of the caller to check whether process belongs to the user.
func Kill ¶
Kill kills the process, if it is running. It is a responsibility of the caller to check whether process belongs to the user.
Types ¶
Click to show internal directories.
Click to hide internal directories.