chaos

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) goresilience.Runner

New returns a new chaos runner. The chaos runner will inject failure using the injector. The injector controls the faults. See Injector to know what kind of failures are controlable.

func NewMiddleware

func NewMiddleware(cfg Config) goresilience.Middleware

NewMiddleware returns a middleware that uses the Runner return by chaos.New.

Types

type Config

type Config struct {
	// Injector is the failer injector for the chaos runner.
	Injector *Injector
}

Config is the configuration of the chaos runner.

type Injector

type Injector struct {
	// contains filtered or unexported fields
}

Injector will control how the faults will be injected in the chaos runner.

func (*Injector) SetErrorPercent

func (i *Injector) SetErrorPercent(percent int) error

SetErrorPercent will set the error percent on the injector.

func (*Injector) SetLatency

func (i *Injector) SetLatency(t time.Duration)

SetLatency will set the latency on the injector.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL