Documentation

Index

Constants

This section is empty.

Variables

var (
	ErrNoExist  = fmt.Errorf("failpoint: failpoint does not exist")
	ErrDisabled = fmt.Errorf("failpoint: failpoint is disabled")
)

var (
	ErrExhausted = fmt.Errorf("failpoint: terms exhausted")
	ErrBadParse  = fmt.Errorf("failpoint: could not parse terms")
)

Functions

func Disable

func Disable(failpath string) error

Disable stops a failpoint from firing.

func Enable

func Enable(failpath, inTerms string) error

Enable sets a failpoint to a given failpoint description.

func List

func List() []string

func Status

func Status(failpath string) (string, error)

Status gives the current setting for the failpoint

Types

type Failpoint

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

func NewFailpoint

func NewFailpoint(pkg, name string, goFailGo bool) *Failpoint

func (*Failpoint) Acquire

func (fp *Failpoint) Acquire() (interface{}, error)

Acquire gets evalutes the failpoint terms; if the failpoint is active, it will return a value. Otherwise, returns a non-nil error.

func (*Failpoint) BadType

func (fp *Failpoint) BadType(v interface{}, t string)

BadType is called when the failpoint evaluates to the wrong type.

func (*Failpoint) Release

func (fp *Failpoint) Release()

Release is called when the failpoint exists.