Documentation ¶
Index ¶
- func GenerateErrorResponse(body string, statusCode int) (*http.Response, func() bool)
- func GenerateResponse(body string, statusCode int, header http.Header) (*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, useContentDisposition bool) (string, error)
- func (_m *IoUtil) Fetch(url string) ([]byte, error)
- func (_m *IoUtil) FileExists(path string) bool
- func (_m *IoUtil) GetFilesByGlob(glob string) ([]string, error)
- func (_m *IoUtil) MkDir(_a0 string) error
- func (_m *IoUtil) ReadFile(path string) ([]byte, error)
- func (_m *IoUtil) RemoveAll(path string) error
- func (_m *IoUtil) RemoveFile(path string) 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
- func (_m *IoUtil) WriteFile(path string, data []byte) 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.
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) Download ¶
Download provides a mock function with given fields: URL, destPath, useContentDisposition
func (*IoUtil) FileExists ¶
FileExists provides a mock function with given fields: path
func (*IoUtil) GetFilesByGlob ¶
GetFilesByGlob provides a mock function with given fields: glob
func (*IoUtil) RemoveFile ¶
RemoveFile provides a mock function with given fields: path
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
}