MCPcopy Create free account
hub / github.com/UiPath/uipathcli / writeBody

Method writeBody

plugin/orchestrator/upload/upload_command.go:86–103  ·  view source on GitHub ↗
(bodyWriter *io.PipeWriter, input stream.Stream, cancel context.CancelCauseFunc)

Source from the content-addressed store, hash-verified

84}
85
86func (c UploadCommand) writeBody(bodyWriter *io.PipeWriter, input stream.Stream, cancel context.CancelCauseFunc) (string, int64) {
87 go func() {
88 defer func() { _ = bodyWriter.Close() }()
89 data, err := input.Data()
90 if err != nil {
91 cancel(err)
92 return
93 }
94 defer func() { _ = data.Close() }()
95 _, err = io.Copy(bodyWriter, data)
96 if err != nil {
97 cancel(err)
98 return
99 }
100 }()
101 size, _ := input.Size()
102 return "application/octet-stream", size
103}
104
105func (c UploadCommand) progressReader(text string, completedText string, reader io.Reader, length int64, progressBar *visualization.ProgressBar) io.Reader {
106 if length < 10*1024*1024 {

Callers 1

createUploadRequestMethod · 0.95

Calls 3

CloseMethod · 0.80
DataMethod · 0.65
SizeMethod · 0.65

Tested by

no test coverage detected