Documentation
¶
Overview ¶
Package randomfailureprocessor provides a processor that randomly fails with a user-configured probability.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a new factory for the processor.
Types ¶
type Config ¶
type Config struct {
// FailureRate is the rate at which failures will occur.
// This is a float between 0 and 1.
// 0.5 means 50% of the time, a failure will occur.
// 1.0 means 100% of the time, a failure will occur.
// 0.0 means 0% of the time, a failure will occur.
// Default is 0.5.
FailureRate float64 `mapstructure:"failure_rate"`
// ErrorMessage is the message that will be returned when a failure occurs.
// Default is "random failure".
ErrorMessage string `mapstructure:"error_message"`
}
Config is the config of the processor.
Click to show internal directories.
Click to hide internal directories.