runtime

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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")
)

Functions

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, int, error)

Status gives the current setting and execution count for the failpoint

Types

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