Documentation ¶
Index ¶
- type Orchestrator
- func (orch *Orchestrator) AttachContainer(ac scheduler.AttachContainerRequest) (scheduler.AttachContainerResponse, error)
- func (orch *Orchestrator) GetLogs(gl scheduler.GetLogsRequest) (io.Reader, error)
- func (orch *Orchestrator) GetState(gs scheduler.GetStateRequest) (scheduler.GetStateResponse, error)
- func (orch *Orchestrator) StartContainer(req scheduler.StartContainerRequest) (scheduler.StartContainerResponse, error)
- func (orch *Orchestrator) StopContainer(req scheduler.StopContainerRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Orchestrator ¶
func (*Orchestrator) AttachContainer ¶ added in v0.6.0
func (orch *Orchestrator) AttachContainer(ac scheduler.AttachContainerRequest) (scheduler.AttachContainerResponse, error)
Attach to a running docker container. Connection should be closed when finished.
func (*Orchestrator) GetLogs ¶
func (orch *Orchestrator) GetLogs(gl scheduler.GetLogsRequest) (io.Reader, error)
GetLogs streams the logs from a docker container to an io.Reader.
To do this we first have to de-muliplex the docker logs as they start in a custom format where both stdout and stderr are part of the same stream. The de-multiplexing is done by the StdCopy function that docker provides.
Since we need to de-multiplex the stream, but still stream it to the caller, we pass the StdCopy function an io.Pipe which simply works a single spaced buffer. For every write the caller must read before another write can move forward.
func (*Orchestrator) GetState ¶
func (orch *Orchestrator) GetState(gs scheduler.GetStateRequest) (scheduler.GetStateResponse, error)
func (*Orchestrator) StartContainer ¶
func (orch *Orchestrator) StartContainer(req scheduler.StartContainerRequest) (scheduler.StartContainerResponse, error)
func (*Orchestrator) StopContainer ¶
func (orch *Orchestrator) StopContainer(req scheduler.StopContainerRequest) error
Click to show internal directories.
Click to hide internal directories.