chaos

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package chaos provides a simple API to inject errors into applications to test error handling in-the-wild.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrChaos is the error returned my MaybeError. It supports checking for chaos errors via: errors.Is(err, chaos.ErrChaos).
	ErrChaos = errors.NewSentinel("chaos error")
)

Functions

func MaybeError

func MaybeError(ctx context.Context) error

MaybeError sometimes returns an error based on the probability set in the context.

func WithErrProbability

func WithErrProbability(ctx context.Context, network netconf.ID) context.Context

WithErrProbability sets the chaos error probability for the given network in the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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