Documentation
¶
Overview ¶
Shell package.
Index ¶
- Constants
- func StartDocker(cfg *ProcessConfig, port string) (*exec.Cmd, error)
- type Executor
- type Forwarder
- type ProcessActor
- type ProcessConfig
- type ProcessInstance
- func (p *ProcessInstance) Close()
- func (p *ProcessInstance) Disconnect()
- func (p *ProcessInstance) ReadRequest(ns *socketio.NameSpace)
- func (p *ProcessInstance) ReadResponse(ns *socketio.NameSpace)
- func (p *ProcessInstance) WriteRequest(ns *socketio.NameSpace)
- func (p *ProcessInstance) WriteResponse(ns *socketio.NameSpace)
- type ProcessServer
- type Result
- type ShellReader
- type ShellWriter
- type Termination
Constants ¶
View Source
const ( PROCESSKEY string = "process" MAXBUFFER int = 8192 DOCKER_ENDPOINT = "unix:///var/run/docker.sock" )
Variables ¶
This section is empty.
Functions ¶
func StartDocker ¶
func StartDocker(cfg *ProcessConfig, port string) (*exec.Cmd, error)
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func (*Executor) Exec ¶
func (e *Executor) Exec(cfg *ProcessConfig) (p *ProcessInstance)
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
func (*Forwarder) Exec ¶
func (f *Forwarder) Exec(cfg *ProcessConfig) *ProcessInstance
type ProcessActor ¶
type ProcessActor interface { Exec(*ProcessConfig) *ProcessInstance // contains filtered or unexported methods }
type ProcessConfig ¶
type ProcessConfig struct { ServiceID string IsTTY bool SaveAs string Envv []string Mount []string Command string LogToStderr bool // log the command output for stderr LogStash struct { Enable bool //enable log stash SettleTime time.Duration //how long to wait for log stash to flush logs before exiting, ex. 1s IdleFlushTime time.Duration //interval log stash flushes its buffer, ex 1ms } }
type ProcessInstance ¶
type ProcessInstance struct { Stdin chan byte Stdout chan byte Stderr chan byte Result chan Result // contains filtered or unexported fields }
func (*ProcessInstance) Close ¶
func (p *ProcessInstance) Close()
func (*ProcessInstance) Disconnect ¶
func (p *ProcessInstance) Disconnect()
func (*ProcessInstance) ReadRequest ¶
func (p *ProcessInstance) ReadRequest(ns *socketio.NameSpace)
func (*ProcessInstance) ReadResponse ¶
func (p *ProcessInstance) ReadResponse(ns *socketio.NameSpace)
func (*ProcessInstance) WriteRequest ¶
func (p *ProcessInstance) WriteRequest(ns *socketio.NameSpace)
func (*ProcessInstance) WriteResponse ¶
func (p *ProcessInstance) WriteResponse(ns *socketio.NameSpace)
type ProcessServer ¶
type ProcessServer struct {
// contains filtered or unexported fields
}
func NewProcessExecutorServer ¶
func NewProcessExecutorServer(port, dockerRegistry string) *ProcessServer
func NewProcessForwarderServer ¶
func NewProcessForwarderServer(addr string) *ProcessServer
func (*ProcessServer) Handle ¶
func (p *ProcessServer) Handle(pattern string, handler http.Handler) error
func (*ProcessServer) ServeHTTP ¶
func (p *ProcessServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Result ¶
type Result struct { ExitCode int Error string Termination Termination }
type ShellReader ¶
type ShellReader struct {
// contains filtered or unexported fields
}
type ShellWriter ¶
type ShellWriter struct {
// contains filtered or unexported fields
}
type Termination ¶
type Termination int
Describes whether a process terminated normally or abnormally
const ( NORMAL Termination = iota // Process terminated normally ABNORMAL // Process terminated abnormally )
Click to show internal directories.
Click to hide internal directories.