Documentation ¶
Overview ¶
Package shell - Run serviced shells
Index ¶
- Constants
- Variables
- func StartDocker(cfg *ProcessConfig, ...) (*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"
)
Variables ¶
View Source
var ( // ErrShellDisabled - Shell disabled error message ErrShellDisabled = errors.New("shell has been disabled for this service") )
Functions ¶
func StartDocker ¶
func StartDocker(cfg *ProcessConfig, masterAddress, workerAddress, dockerRegistry, controller string) (*exec.Cmd, error)
StartDocker - Start a docker container
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 } }
ProcessConfig - Configuration of process running the shell
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(masterAddress, agentAddress, dockerRegistry, controllerBinary string) *ProcessServer
NewProcessExecutorServer - Create and return a processServer instance
func NewProcessForwarderServer ¶
func NewProcessForwarderServer(addr string) *ProcessServer
func (*ProcessServer) Handle ¶
func (s *ProcessServer) Handle(pattern string, handler http.Handler) error
func (*ProcessServer) ServeHTTP ¶
func (s *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
Termination - Describes whether a process terminated normally or abnormally
const ( // NORMAL - Process terminated normally NORMAL Termination = iota // ABNORMAL - Process terminated abnormally ABNORMAL )
Click to show internal directories.
Click to hide internal directories.