diagnostics

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSuppressionWindow = time.Minute
	DefaultSuppressionKeys   = 4096
)
View Source
const DefaultRingCapacity = 20

Variables

This section is empty.

Functions

func RedactURI

func RedactURI(raw string) string

func SanitizeText

func SanitizeText(raw string) string

Types

type Event

type Event struct {
	Code    string    `json:"code"`
	Stage   string    `json:"stage"`
	Message string    `json:"message"`
	URI     string    `json:"uri,omitempty"`
	At      time.Time `json:"at"`
}

type Ring

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

func NewRing

func NewRing(capacity int) *Ring

func (*Ring) Record

func (r *Ring) Record(event Event) bool

func (*Ring) Snapshot

func (r *Ring) Snapshot() []Event

type SuppressionDecision

type SuppressionDecision struct {
	Allow   bool
	Summary *SuppressionSummary
}

type SuppressionKey

type SuppressionKey struct {
	Source     string
	Target     string
	PathKind   string
	Stage      string
	ReasonCode string
}

type SuppressionSummary

type SuppressionSummary struct {
	Key             SuppressionKey
	Kind            string
	SuppressedCount uint64
}

type Suppressor

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

func NewSuppressor

func NewSuppressor(opts SuppressorOptions) *Suppressor

func (*Suppressor) Contains

func (s *Suppressor) Contains(key SuppressionKey) bool

func (*Suppressor) Len

func (s *Suppressor) Len() int

func (*Suppressor) Observe

func (s *Suppressor) Observe(key SuppressionKey, now time.Time) SuppressionDecision

func (*Suppressor) Recover

func (s *Suppressor) Recover(key SuppressionKey, now time.Time) *SuppressionSummary

type SuppressorOptions

type SuppressorOptions struct {
	Window  time.Duration
	MaxKeys int
}

Jump to

Keyboard shortcuts

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