refactor: use io.ReadCloser instead of **os.File for binary request params (#119)

This commit is contained in:
Daniel Moran
2021-06-11 17:35:01 -04:00
committed by GitHub
parent b1ba53bae2
commit 0acb80b044
14 changed files with 28 additions and 246 deletions

View File

@ -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