You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 22, 2020. It is now read-only.
We have a frequent use for getting some file contents and knowing its size up-front; in the client when we want to upload things and in the server when we return things.
A rough sketch:
package main
import (
"fmt""io""os"
)
typeSizeReaderinterface {
io.ReaderSize() int64
}
typeSizeFilestruct {
*os.File
}
func (sf*SizeFile) Size() int64 {
stat, _:=sf.Stat()
ifstat==nil {
return0
}
returnstat.Size()
}
// Add things that makes sized random readers, network, ...funcmain() {
x, err:=os.Open("./test.go")
iferr!=nil {
panic(err)
}
sf:=&SizeFile{x}
fmt.Println(x, err, sf.Size())
}
Would also be useful for the streaming put/get interfaces...
The text was updated successfully, but these errors were encountered:
msiebuhr
changed the title
Replace PutObject with compsed struct
Replace PutObject with composed struct
Nov 30, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We have a frequent use for getting some file contents and knowing its size up-front; in the client when we want to upload things and in the server when we return things.
A rough sketch:
Would also be useful for the streaming put/get interfaces...
The text was updated successfully, but these errors were encountered: