faults

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeCorrelatedFailureDomain   = "correlated_failure_domain"
	TypeEdgeFailStop              = "edge_fail_stop"
	TypeEdgePartialDegradation    = "edge_partial_degradation"
	TypeServicePartialDegradation = "service_partial_degradation"
)
View Source
const (
	MetricExpectedSuccessRate      = "expected_success_rate"
	MetricMaxAmplificationFactor   = "max_amplification_factor"
	MetricTimeoutMismatchCount     = "timeout_mismatch_count"
	MetricBlastRadiusServiceCount  = "blast_radius_service_count"
	MetricBlastRadiusEndpointCount = "blast_radius_endpoint_count"
)
View Source
const (
	TargetEndpoint = "endpoint"
	TargetPath     = "path"
	TargetEdge     = "edge"
	TargetProfile  = "profile"
)
View Source
const SchemaVersion = "1.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Assertion

type Assertion struct {
	Metric string          `json:"metric" yaml:"metric"`
	Target AssertionTarget `json:"target" yaml:"target"`
	Op     string          `json:"op" yaml:"op"`
	Value  float64         `json:"value" yaml:"value"`
}

func (Assertion) Validate

func (a Assertion) Validate() error

type AssertionTarget

type AssertionTarget struct {
	Type       string   `json:"type" yaml:"type"`
	EndpointID string   `json:"endpoint_id,omitempty" yaml:"endpoint_id,omitempty"`
	Services   []string `json:"services,omitempty" yaml:"services,omitempty"`
	EdgeID     string   `json:"edge_id,omitempty" yaml:"edge_id,omitempty"`
}

func (AssertionTarget) Validate

func (t AssertionTarget) Validate() error

type Contract

type Contract struct {
	SchemaVersion string             `json:"schema_version" yaml:"schema_version"`
	Profiles      map[string]Profile `json:"profiles" yaml:"profiles"`
}

func Load

func Load(path string) (Contract, error)

func (Contract) Validate

func (c Contract) Validate() error

type Fault

type Fault struct {
	Type                string                `json:"type" yaml:"type"`
	Selector            Selector              `json:"selector" yaml:"selector"`
	OnlyFailureEligible bool                  `json:"only_failure_eligible,omitempty" yaml:"only_failure_eligible,omitempty"`
	ErrorRate           *float64              `json:"error_rate,omitempty" yaml:"error_rate,omitempty"`
	LatencyMS           *model.LatencySummary `json:"latency_ms,omitempty" yaml:"latency_ms,omitempty"`
}

func (Fault) Validate

func (f Fault) Validate() error

type Profile

type Profile struct {
	Faults     []Fault     `json:"faults,omitempty" yaml:"faults,omitempty"`
	Assertions []Assertion `json:"assertions,omitempty" yaml:"assertions,omitempty"`
}

type Selector

type Selector struct {
	ServiceIDs         []string          `json:"service_ids,omitempty" yaml:"service_ids,omitempty"`
	ServiceLabels      map[string]string `json:"service_labels,omitempty" yaml:"service_labels,omitempty"`
	PlacementLabels    map[string]string `json:"placement_labels,omitempty" yaml:"placement_labels,omitempty"`
	SharedResourceRefs []string          `json:"shared_resource_refs,omitempty" yaml:"shared_resource_refs,omitempty"`
	EdgeIDs            []string          `json:"edge_ids,omitempty" yaml:"edge_ids,omitempty"`
}

func (Selector) Validate

func (s Selector) Validate() error

Jump to

Keyboard shortcuts

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