Documentation ¶
Overview ¶
Package cosash implements a "co-processing" proxy that is primarily designed to expose a Go API that is currently implemented by `src/cmdlib.sh`. A lot of the code in that file is stateful - e.g. APIs set environment variables and allocate temporary directories. So it wouldn't work very well to fork a new shell process each time.
The "co-processing" here is a way to describe that there's intended to be a one-to-one relationship of the child bash process and the current one, although this is not strictly required. The Go APIs here call dynamically into the bash process by writing to its stdin, and can receive serialized data back over a pipe on file descriptor 3.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CosaSh ¶
type CosaSh struct {
// contains filtered or unexported fields
}
CosaSh is a companion shell process which accepts commands piped over stdin.
func (*CosaSh) HasPrivileges ¶
HasPrivileges checks if we can use sudo
func (*CosaSh) PrepareBuild ¶
PrepareBuild prepares for a build, returning the newly allocated build directory