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

Method Run

client/connection/connection.go:164–186  ·  view source on GitHub ↗
(handle string, spec garden.ProcessSpec, processIO garden.ProcessIO)

Source from the content-addressed store, hash-verified

162}
163
164func (c *connection) Run(handle string, spec garden.ProcessSpec, processIO garden.ProcessIO) (garden.Process, error) {
165 reqBody := new(bytes.Buffer)
166
167 err := transport.WriteMessage(reqBody, spec)
168 if err != nil {
169 return nil, err
170 }
171
172 hijackedConn, hijackedResponseReader, err := c.hijacker.Hijack(
173 routes.Run,
174 reqBody,
175 rata.Params{
176 "handle": handle,
177 },
178 nil,
179 "application/json",
180 )
181 if err != nil {
182 return nil, err
183 }
184
185 return c.streamProcess(handle, processIO, hijackedConn, hijackedResponseReader)
186}
187
188func (c *connection) Attach(handle string, processID string, processIO garden.ProcessIO) (garden.Process, error) {
189 reqBody := new(bytes.Buffer)

Callers

nothing calls this directly

Calls 3

streamProcessMethod · 0.95
WriteMessageFunction · 0.92
HijackMethod · 0.65

Tested by

no test coverage detected