refactor: use io.ReadCloser instead of **os.File for binary request params (#119)
This commit is contained in:
@ -12,7 +12,6 @@ package api
|
||||
|
||||
import (
|
||||
_context "context"
|
||||
_io "io"
|
||||
_ioutil "io/ioutil"
|
||||
_nethttp "net/http"
|
||||
_neturl "net/url"
|
||||
@ -54,22 +53,6 @@ type SetupApi interface {
|
||||
PostSetupExecute(r ApiPostSetupRequest) (OnboardingResponse, error)
|
||||
}
|
||||
|
||||
// setupApiGzipReadCloser supports streaming gzip response-bodies directly from the server.
|
||||
type setupApiGzipReadCloser struct {
|
||||
underlying _io.ReadCloser
|
||||
gzip _io.ReadCloser
|
||||
}
|
||||
|
||||
func (gzrc *setupApiGzipReadCloser) Read(p []byte) (int, error) {
|
||||
return gzrc.gzip.Read(p)
|
||||
}
|
||||
func (gzrc *setupApiGzipReadCloser) Close() error {
|
||||
if err := gzrc.gzip.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
return gzrc.underlying.Close()
|
||||
}
|
||||
|
||||
// SetupApiService SetupApi service
|
||||
type SetupApiService service
|
||||
|
||||
|
Reference in New Issue
Block a user