Documentation ¶
Index ¶
- func GenerateErrorResponse(body string, statusCode int) (*http.Response, func() bool)
- func GenerateResponse(body string, statusCode int) (*http.Response, func() bool)
- func NewTestHTTPClient(response *http.Response, err error) *http.Client
- type IoUtil
- func (_m *IoUtil) CopyFile(src string, dest string) error
- func (_m *IoUtil) CopyResource(src string, dest string) error
- func (_m *IoUtil) CreateFile(file string, tr io.Reader) error
- func (_m *IoUtil) Download(URL string, destPath string) error
- func (_m *IoUtil) Fetch(url string) ([]byte, error)
- func (_m *IoUtil) ResolveDestPath(filePath string, destDir string) string
- func (_m *IoUtil) ResolveDestPathFromURL(url string, destDir string) string
- func (_m *IoUtil) TempDir(_a0 string, _a1 string) (string, error)
- func (_m *IoUtil) Untar(tarPath string, dest string) error
- func (_m *IoUtil) Unzip(arch string, dest string) error
- type MockResponseBodyImpl
- type MockRoundTripper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateErrorResponse ¶ added in v0.15.2
GenerateErrorResponse generates a mocked *http.Response and returns a function that allows checking if the body of the response has been closed. The body will throw and error when read.
func GenerateResponse ¶ added in v0.15.2
GenerateResponse generates a mocked *http.Response and returns a function that allows checking if this response's body has been closed.
Types ¶
type IoUtil ¶
IoUtil is an autogenerated mock type for the IoUtil type
func (*IoUtil) CopyResource ¶
CopyResource provides a mock function with given fields: src, dest
func (*IoUtil) CreateFile ¶
CreateFile provides a mock function with given fields: file, tr
func (*IoUtil) ResolveDestPath ¶
ResolveDestPath provides a mock function with given fields: filePath, destDir
func (*IoUtil) ResolveDestPathFromURL ¶
ResolveDestPathFromURL provides a mock function with given fields: url, destDir
type MockResponseBodyImpl ¶ added in v0.15.2
type MockResponseBodyImpl struct {
// contains filtered or unexported fields
}
MockResponseBodyImpl is an implementation of MockResponseBody
func (MockResponseBodyImpl) Close ¶ added in v0.15.2
func (body MockResponseBodyImpl) Close() error
Close simply sets body.isClosed to true. Useful for checking that response body is closed.
func (MockResponseBodyImpl) IsClosed ¶ added in v0.15.2
func (body MockResponseBodyImpl) IsClosed() bool
IsClosed returns whether or not Close has been called on this body.
type MockRoundTripper ¶ added in v0.15.2
type MockRoundTripper struct {
// contains filtered or unexported fields
}