(bodyWriter *io.PipeWriter, stream stream.Stream, contentType string, cancel context.CancelCauseFunc)
| 119 | } |
| 120 | |
| 121 | func (c OrchestratorClient) writeMultipartBody(bodyWriter *io.PipeWriter, stream stream.Stream, contentType string, cancel context.CancelCauseFunc) string { |
| 122 | formWriter := multipart.NewWriter(bodyWriter) |
| 123 | go func() { |
| 124 | defer func() { _ = bodyWriter.Close() }() |
| 125 | defer func() { _ = formWriter.Close() }() |
| 126 | err := c.writeMultipartForm(formWriter, stream, contentType) |
| 127 | if err != nil { |
| 128 | cancel(err) |
| 129 | return |
| 130 | } |
| 131 | }() |
| 132 | return formWriter.FormDataContentType() |
| 133 | } |
| 134 | |
| 135 | func (c OrchestratorClient) writeMultipartForm(writer *multipart.Writer, stream stream.Stream, contentType string) error { |
| 136 | filePart := textproto.MIMEHeader{} |
no test coverage detected