startup_failpoints

package
v2.10.52 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailPoint

type FailPoint struct {
	Error FailPointError `json:"error"`
	// when empty, Error.String() will be taken
	ErrorName  string   `json:"errorName"`
	IsActive   bool     `json:"isActive"`
	FilterTags []string `json:"filterTags"`

	// Locations restricts the failure to those code locations: it is only offered
	// there and can only be armed there. Empty means every location, which is what
	// a generic failure (a timeout, a 500) wants. A service whose locations are
	// different peers uses it to keep one peer's product errors out of another
	// peer's dropdown.
	Locations []FailPointLocation `json:"locations,omitempty"`
}

func NewFailPoint

func NewFailPoint(err FailPointError) FailPoint

type FailPointError

type FailPointError interface {
	error
}

type FailPointLocation

type FailPointLocation string

type FailPointRequest

type FailPointRequest struct {
	CodeLocationPointName FailPointLocation `json:"codeLocationPointName"`
	FailPointErrorName    string            `json:"failPointCode"`
	Active                bool              `json:"active"`
	FilterTags            string            `json:"filterTags"`
}

type FailPointService

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

func NewFailPointService

func NewFailPointService(fps []FailPoint, codeLocations []FailPointLocation, devMode bool) *FailPointService

func (*FailPointService) FailPointsByLocation added in v2.10.5

func (f *FailPointService) FailPointsByLocation() map[FailPointLocation][]FailPoint

FailPointsByLocation is the per-location selection the page renders.

func (*FailPointService) FailPointsFor added in v2.10.5

func (f *FailPointService) FailPointsFor(location FailPointLocation) []FailPoint

FailPointsFor returns the fail points offered at location, in the order the page should show them.

func (*FailPointService) GetFailPointLocations

func (f *FailPointService) GetFailPointLocations() map[FailPointLocation]FailPoint

func (*FailPointService) GetFailPoints

func (f *FailPointService) GetFailPoints() []FailPoint

func (*FailPointService) HandleFailPointPage

func (f *FailPointService) HandleFailPointPage(updateFailPointsEndpoint string) http.HandlerFunc

func (*FailPointService) NewFailPointRequest

func (f *FailPointService) NewFailPointRequest() FailPointRequest

func (*FailPointService) ReturnErrorIfFailPointActive

func (f *FailPointService) ReturnErrorIfFailPointActive(ctx context.Context, location FailPointLocation, filterTags ...string) error

ReturnErrorIfFailPointActive returns an error if the failpoint is active. If the failpoint is not active, it returns nil. filterTags is a list of tags that can be used to filter the failpoint as a condition for activation.

func (*FailPointService) UpdateFailPoint

func (f *FailPointService) UpdateFailPoint(req FailPointRequest) error

func (*FailPointService) UpdateFailPointHandlerFunc

func (f *FailPointService) UpdateFailPointHandlerFunc() http.HandlerFunc

type TemplateResponse

type TemplateResponse struct {
	UpdateFailPointsEndpoint string
	FailPoints               []FailPoint
	FailPointLocations       map[FailPointLocation]FailPoint
	// FailPointsByLocation is the per-location dropdown; FailPoints stays the
	// full list for callers that render their own page.
	FailPointsByLocation map[FailPointLocation][]FailPoint
}

Jump to

Keyboard shortcuts

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