v0.1.0 Latest Latest

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 11 Imported by: 0




This section is empty.


View Source
var (
	ErrNoExist  = fmt.Errorf("failpoint: failpoint does not exist")
	ErrDisabled = fmt.Errorf("failpoint: failpoint is disabled")
View Source
var (
	ErrExhausted = fmt.Errorf("failpoint: terms exhausted")
	ErrBadParse  = fmt.Errorf("failpoint: could not parse terms")


func Disable

func Disable(name string) error

Disable stops a failpoint from firing.

func Enable

func Enable(name, 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


type Failpoint

type Failpoint struct {
	// contains filtered or unexported fields

func NewFailpoint

func NewFailpoint(name string) *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.

Jump to

Keyboard shortcuts

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