breaker

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const SkipThreshold = 5

SkipThreshold is how many consecutive identical statuses trigger a skip.

View Source
const TimeoutThreshold = 3

TimeoutThreshold is consecutive errors/timeouts before skip.

Variables

This section is empty.

Functions

func Key

func Key(method, host, path string) string

Key builds a stable endpoint signature.

Types

type Skipped

type Skipped struct {
	Host   string `json:"host"`
	Path   string `json:"path"`
	Method string `json:"method"`
	Reason string `json:"reason"`
}

Skipped describes an endpoint removed from the active-scan queue.

type Tracker

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

Tracker skips endpoints after repeated failure statuses or transport errors.

func New

func New() *Tracker

New returns a fresh per-run tracker.

func (*Tracker) Record

func (t *Tracker) Record(key, method, host, path string, status int, transportErr bool)

Record observes one probe result; may mark the endpoint skipped.

func (*Tracker) ShouldSkip

func (t *Tracker) ShouldSkip(key string) (bool, string)

ShouldSkip reports whether probing should stop for this endpoint.

func (*Tracker) SkippedList

func (t *Tracker) SkippedList() []Skipped

SkippedList returns all skipped endpoints for this run.

Jump to

Keyboard shortcuts

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