Documentation
¶
Index ¶
- func WriteToFile(path string, mdl ResilienceModel) error
- type BackoffPolicy
- type CircuitBreakerPolicy
- type CommonMetadata
- type Edge
- type EdgeKind
- type EdgeMetadata
- type Endpoint
- type EndpointMetadata
- type LatencySummary
- type Metadata
- type ObservedEdge
- type Placement
- type PolicyScope
- type ResilienceModel
- type ResiliencePolicy
- type RetryPolicy
- type Schema
- type Service
- type ServiceMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteToFile ¶
func WriteToFile(path string, mdl ResilienceModel) error
Types ¶
type BackoffPolicy ¶ added in v0.2.0
type CircuitBreakerPolicy ¶ added in v0.2.0
type CircuitBreakerPolicy struct {
Enabled *bool `json:"enabled,omitempty"`
MaxPendingRequests int `json:"max_pending_requests,omitempty"`
MaxRequests int `json:"max_requests,omitempty"`
MaxConnections int `json:"max_connections,omitempty"`
Consecutive5xx int `json:"consecutive_5xx,omitempty"`
IntervalMS int `json:"interval_ms,omitempty"`
BaseEjectionTimeMS int `json:"base_ejection_time_ms,omitempty"`
}
type CommonMetadata ¶ added in v0.2.0
type Edge ¶
type Edge struct {
ID string `json:"id,omitempty"`
From string `json:"from"`
To string `json:"to"`
Kind EdgeKind `json:"kind"`
Blocking bool `json:"blocking"`
Metadata *EdgeMetadata `json:"metadata,omitempty"`
Resilience *ResiliencePolicy `json:"resilience,omitempty"`
Observed *ObservedEdge `json:"observed,omitempty"`
PolicyScope *PolicyScope `json:"policy_scope,omitempty"`
}
type EdgeMetadata ¶ added in v0.2.0
type EdgeMetadata struct {
CommonMetadata
Weight *float64 `json:"weight,omitempty"`
}
type Endpoint ¶
type Endpoint struct {
ID string `json:"id"`
EntryService string `json:"entry_service"`
SuccessPredicateRef string `json:"success_predicate_ref"`
SuccessPredicate *predicates.Definition `json:"success_predicate,omitempty"`
Method string `json:"method,omitempty"`
Path string `json:"path,omitempty"`
Metadata *EndpointMetadata `json:"metadata,omitempty"`
}
type EndpointMetadata ¶ added in v0.2.0
type EndpointMetadata struct {
CommonMetadata
Weight *float64 `json:"weight,omitempty"`
}
type LatencySummary ¶ added in v0.2.0
type ObservedEdge ¶ added in v0.2.0
type ObservedEdge struct {
LatencyMS *LatencySummary `json:"latency_ms,omitempty"`
ErrorRate *float64 `json:"error_rate,omitempty"`
}
type PolicyScope ¶ added in v0.2.0
type ResilienceModel ¶
type ResilienceModel struct {
Services []Service `json:"services"`
Edges []Edge `json:"edges"`
Endpoints []Endpoint `json:"endpoints"`
Predicates map[string]predicates.Definition `json:"predicates,omitempty"`
EndpointWeights map[string]float64 `json:"endpoint_weights,omitempty"`
Metadata Metadata `json:"metadata"`
}
func LoadFromFile ¶
func LoadFromFile(path string) (ResilienceModel, error)
func (ResilienceModel) SortedEndpointIDs ¶
func (m ResilienceModel) SortedEndpointIDs() []string
func (ResilienceModel) Validate ¶
func (m ResilienceModel) Validate() error
type ResiliencePolicy ¶ added in v0.2.0
type ResiliencePolicy struct {
RequestTimeoutMS int `json:"request_timeout_ms,omitempty"`
PerTryTimeoutMS int `json:"per_try_timeout_ms,omitempty"`
Retry *RetryPolicy `json:"retry,omitempty"`
CircuitBreaker *CircuitBreakerPolicy `json:"circuit_breaker,omitempty"`
}
type RetryPolicy ¶ added in v0.2.0
type RetryPolicy struct {
MaxAttempts int `json:"max_attempts,omitempty"`
BudgetCap float64 `json:"budget_cap,omitempty"`
RetryOn []string `json:"retry_on,omitempty"`
Backoff *BackoffPolicy `json:"backoff,omitempty"`
}
type Service ¶
type Service struct {
ID string `json:"id"`
Name string `json:"name"`
Replicas int `json:"replicas"`
Metadata *ServiceMetadata `json:"metadata,omitempty"`
}
type ServiceMetadata ¶ added in v0.2.0
type ServiceMetadata struct {
CommonMetadata
FailureEligible *bool `json:"failure_eligible,omitempty"`
Placements []Placement `json:"placements,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.