failinject

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeAbort = "abort"
	TypeDelay = "delay"

	TriggerTypeRandom     = "random"
	TriggerTypeAlways     = "always"
	TriggerTypePercentage = "percentage"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Rules map[URI]*Rule `yaml:"fail_inject_rules" json:"fail_inject_rules"`
}

type Filter

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

func (Filter) Decode

type FilterFactory

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

func (*FilterFactory) Apply

func (factory *FilterFactory) Apply() error

func (*FilterFactory) Config

func (factory *FilterFactory) Config() interface{}

func (*FilterFactory) PrepareFilterChain

func (factory *FilterFactory) PrepareFilterChain(ctx *contextHttp.HttpContext, chain filter.FilterChain) error

type Plugin

type Plugin struct {
}

func (*Plugin) CreateFilterFactory

func (p *Plugin) CreateFilterFactory() (filter.HttpFilterFactory, error)

func (*Plugin) Kind

func (p *Plugin) Kind() string

type Rule

type Rule struct {
	StatusCode  int           `yaml:"status_code" json:"status_code"`
	Body        string        `yaml:"body" json:"body"`
	Type        string        `yaml:"type" json:"type"`                 // abort, delay
	TriggerType string        `yaml:"trigger_type" json:"trigger_type"` // random, always, percentage
	Odds        int           `yaml:"odds" json:"odds"`                 // 0-100
	Delay       time.Duration `yaml:"delay" json:"delay"`
}

type URI

type URI string

Jump to

Keyboard shortcuts

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