Documentation ¶
Overview ¶
Package fault handles fault injection for testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Injector ¶
type Injector struct {
// contains filtered or unexported fields
}
An Injector reports whether fake errors should be returned.
func NewInjector ¶
NewInjector returns a new fault injector with the given name. The environment variable "FAULT_" + capital(name) + "_FAIL_PERCENT" controls the percentage of requests that fail. If undefined or zero, no requests fail.
func (*Injector) FailErr ¶
FailErr checks ShouldFail and, if true, assigns a fake error to err and returns true.
func (*Injector) ShouldFail ¶
ShouldFail reports whether a fake error should be returned.
Click to show internal directories.
Click to hide internal directories.