flaws

package
v0.0.0-...-f6f85ec Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flaw

type Flaw interface {
	Middleware(w http.ResponseWriter, r *http.Request) FlawResult
	Name() string
}

type FlawMiddleware

type FlawMiddleware struct {
	Flaw      Flaw
	RunOption RunOption
}

func Of

func Of(flaw Flaw, runOption RunOption) FlawMiddleware

func (FlawMiddleware) Middleware

func (f FlawMiddleware) Middleware(next http.Handler) http.Handler

type FlawResult

type FlawResult int
const (
	CONTINUE FlawResult = iota
	INTERRUPT
)

type HttpStatusCodeFlaw

type HttpStatusCodeFlaw struct {
	Status int
}

func NewHttpStatusCode

func NewHttpStatusCode(status int) HttpStatusCodeFlaw

func (HttpStatusCodeFlaw) Middleware

func (HttpStatusCodeFlaw) Name

func (l HttpStatusCodeFlaw) Name() string

type LatencyFlaw

type LatencyFlaw struct {
	Min int
	Max int
}

func NewFixedLatency

func NewFixedLatency(value int) LatencyFlaw

func NewRandomLatency

func NewRandomLatency(min int, max int) LatencyFlaw

func (LatencyFlaw) Middleware

func (l LatencyFlaw) Middleware(w http.ResponseWriter, r *http.Request) FlawResult

func (LatencyFlaw) Name

func (l LatencyFlaw) Name() string

type RunAlways

type RunAlways struct{}

func (RunAlways) CanRun

func (RunAlways) CanRun() bool

type RunOption

type RunOption interface {
	CanRun() bool
}

type RunPerc

type RunPerc struct {
	Percentage int
}

func (RunPerc) CanRun

func (r RunPerc) CanRun() bool

Jump to

Keyboard shortcuts

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