MCPcopy Create free account
hub / github.com/cloudfoundry/garden / Attach

Method Attach

client/connection/connection.go:188–206  ·  view source on GitHub ↗
(handle string, processID string, processIO garden.ProcessIO)

Source from the content-addressed store, hash-verified

186}
187
188func (c *connection) Attach(handle string, processID string, processIO garden.ProcessIO) (garden.Process, error) {
189 reqBody := new(bytes.Buffer)
190
191 hijackedConn, hijackedResponseReader, err := c.hijacker.Hijack(
192 routes.Attach,
193 reqBody,
194 rata.Params{
195 "handle": handle,
196 "pid": processID,
197 },
198 nil,
199 "",
200 )
201 if err != nil {
202 return nil, err
203 }
204
205 return c.streamProcess(handle, processIO, hijackedConn, hijackedResponseReader)
206}
207
208func (c *connection) streamProcess(handle string, processIO garden.ProcessIO, hijackedConn net.Conn, hijackedResponseReader *bufio.Reader) (garden.Process, error) {
209 decoder := json.NewDecoder(hijackedResponseReader)

Callers

nothing calls this directly

Calls 2

streamProcessMethod · 0.95
HijackMethod · 0.65

Tested by

no test coverage detected