Versions in this module Expand all Collapse all v1 v1.0.2 Feb 20, 2024 v1.0.1 Aug 9, 2023 Changes in this version + var ErrInvalidHTTPCode = errors.New("not a valid http status code") + var ErrInvalidPercent = errors.New("percent must be 0.0 <= percent <= 1.0") + var ErrNilInjector = errors.New("injector cannot be nil") + type ChainInjector struct + func NewChainInjector(is []Injector, opts ...ChainInjectorOption) (*ChainInjector, error) + func (i *ChainInjector) Handler(next http.Handler) http.Handler + type ChainInjectorOption interface + type ErrorInjector struct + func NewErrorInjector(code int, opts ...ErrorInjectorOption) (*ErrorInjector, error) + func (i *ErrorInjector) Handler(next http.Handler) http.Handler + type ErrorInjectorOption interface + func WithStatusText(t string) ErrorInjectorOption + type Fault struct + func NewFault(i Injector, opts ...Option) (*Fault, error) + func (f *Fault) Handler(next http.Handler) http.Handler + func (f *Fault) SetEnabled(o enabledOption) error + func (f *Fault) SetParticipation(o participationOption) error + type Injector interface + Handler func(next http.Handler) http.Handler + type InjectorState int + const StateFinished + const StateSkipped + const StateStarted + type NoopReporter struct + func NewNoopReporter() *NoopReporter + func (r *NoopReporter) Report(name string, state InjectorState) + type Option interface + func WithEnabled(e bool) Option + func WithHeaderAllowlist(allowlist map[string]string) Option + func WithHeaderBlocklist(blocklist map[string]string) Option + func WithParticipation(p float32) Option + func WithPathAllowlist(allowlist []string) Option + func WithPathBlocklist(blocklist []string) Option + func WithRandFloat32Func(f func() float32) Option + type RandSeedOption interface + func WithRandSeed(s int64) RandSeedOption + type RandomInjector struct + func NewRandomInjector(is []Injector, opts ...RandomInjectorOption) (*RandomInjector, error) + func (i *RandomInjector) Handler(next http.Handler) http.Handler + type RandomInjectorOption interface + func WithRandIntFunc(f func(int) int) RandomInjectorOption + type RejectInjector struct + func NewRejectInjector(opts ...RejectInjectorOption) (*RejectInjector, error) + func (i *RejectInjector) Handler(next http.Handler) http.Handler + type RejectInjectorOption interface + type Reporter interface + Report func(name string, state InjectorState) + type ReporterOption interface + func WithReporter(r Reporter) ReporterOption + type SlowInjector struct + func NewSlowInjector(d time.Duration, opts ...SlowInjectorOption) (*SlowInjector, error) + func (i *SlowInjector) Handler(next http.Handler) http.Handler + type SlowInjectorOption interface + func WithSlowFunc(f func(t time.Duration)) SlowInjectorOption