Documentation
¶
Index ¶
- func ForceOSCloseError(errs ...error) (patch *monkey.PatchGuard)
- func ForceTimeNow(val time.Time) (patch *monkey.PatchGuard)
- func OneShotForceFilePathAbsError(errs ...error)
- func OneShotForceFilePathGlobError(errs ...error)
- func OneShotForceIOCopyError(errs ...error)
- func OneShotForceOSChmodError(errs ...error)
- func OneShotForceOSChtimesError(errs ...error)
- func OneShotForceOSCloseError(errs ...error)
- func OneShotForceOSCreateError(errs ...error)
- func OneShotForceOSReadAtError(errs ...error)
- func OneShotForceOSReadError(errs ...error)
- func OneShotForceOSReaddirnamesError(errs ...error)
- func OneShotForceOSReadlinkError(errs ...error)
- func OneShotForceOSSyncError(errs ...error)
- func OneShotForceOSTruncateError(errs ...error)
- func OneShotForceOSWriteAtError(errs ...error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForceOSCloseError ¶
func ForceOSCloseError(errs ...error) (patch *monkey.PatchGuard)
ForceOSCloseError patches *os.File.Close to Close the file then return an error. Removing the patch is up to the caller. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func ForceTimeNow ¶
func ForceTimeNow(val time.Time) (patch *monkey.PatchGuard)
ForceTimeNow patches time.Now to return the given value. Removing the patch is up to the caller. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceFilePathAbsError ¶
func OneShotForceFilePathAbsError(errs ...error)
OneShotForceFilePathAbsError patches filepath.Abs to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceFilePathGlobError ¶
func OneShotForceFilePathGlobError(errs ...error)
OneShotForceFilePathGlobError patches filepath.Chmod to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceIOCopyError ¶
func OneShotForceIOCopyError(errs ...error)
OneShotForceIOCopyError patches io.Copy to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSChmodError ¶
func OneShotForceOSChmodError(errs ...error)
OneShotForceOSChmodError patches os.Chmod to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSChtimesError ¶
func OneShotForceOSChtimesError(errs ...error)
OneShotForceOSChtimesError patches os.Chtimesto return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSCloseError ¶
func OneShotForceOSCloseError(errs ...error)
OneShotForceOSCloseError patches *os.File.Close to Close the file then return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSCreateError ¶
func OneShotForceOSCreateError(errs ...error)
OneShotForceOSCreateError patches os.Create to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSReadAtError ¶
func OneShotForceOSReadAtError(errs ...error)
OneShotForceOSReadAtError patches *os.File.ReadAt to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSReadError ¶
func OneShotForceOSReadError(errs ...error)
OneShotForceOSReadError patches *os.File.Read to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSReaddirnamesError ¶
func OneShotForceOSReaddirnamesError(errs ...error)
OneShotForceOSReaddirnamesError patches *os.File.Readdirnames to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSReadlinkError ¶
func OneShotForceOSReadlinkError(errs ...error)
OneShotForceOSReadlinkError patches os.Readlink to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSSyncError ¶
func OneShotForceOSSyncError(errs ...error)
OneShotForceOSSyncError patches *os.File.Sync to Sync the file then return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSTruncateError ¶
func OneShotForceOSTruncateError(errs ...error)
OneShotForceOSTruncateError patches *os.File.Truncate to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
func OneShotForceOSWriteAtError ¶
func OneShotForceOSWriteAtError(errs ...error)
OneShotForceOSWriteAtError patches *os.File.WriteAt to return an error. Once it has been triggered it removes the patch and operates as per normal. This patch requires the -gcflags=-l to operate correctly e.g. go test -gcflags=-l ./pkg/sys
Types ¶
This section is empty.