Try to construct an io.Pipe maybe
pReader, pWriter := io.Pipe()
writer:= &cipher.StreamWriter{S: stream, W: pWriter}
UploadFile(outputFileName, metadata, pReader)
writer.Write(src)
On 02/02/2017 10:27 PM, Justin C wrote:
I have a encryption function that gives a cipher.StreamWriter
writer := &cipher.StreamWriter{S: stream, W: outFile}
I am trying to upload it to using a library that has a function that
is uploadFile that requires a IO.reader is there a way to pass the
writer to the io.reader so the file is in crypted then uploaded?
UploadFile(outputFileName, metadata, io.Reader)
My code looks like this
writer := &cipher.StreamWriter{S: stream, W: outFile}
// Copy the input file to the output file, encrypting as we go.
metadata := make(map[string]string)
b2h.currentBucket.UploadFile(outputFileName, metadata, writer)
I get this error.
cannot use writer (type *cipher.StreamWriter) as type io.Reader in
argument to b2h.currentBucket.UploadFile: *cipher.StreamWriter does
not implement io.Reader (missing Read method)
I'm having a little trouble understanding how this is suppose to work
together.
Does anyone have any ideas?
Thank you!
--
You received this message because you are subscribed to the Google
Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to golang-nuts+unsubscr...@googlegroups.com
<mailto:golang-nuts+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.