Documentation
¶
Index ¶
- func Diagnose(run *model.Run, rules []Rule) []model.Finding
- func Evaluate(ctx *RunContext, rules []Rule) []model.Finding
- type Rule
- type RunContext
- func (c *RunContext) EffectiveConfig() *model.EffectiveConfig
- func (c *RunContext) Events() []model.Event
- func (c *RunContext) EventsForService(name string) []model.Event
- func (c *RunContext) Invocation() *model.Invocation
- func (c *RunContext) Run() *model.Run
- func (c *RunContext) Service(name string) *model.Service
- func (c *RunContext) Services() []*model.Service
- func (c *RunContext) SetCausalPriority(priority map[string]int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Rule ¶
type Rule interface {
ID() string
Description() string
Evaluate(ctx *RunContext) []model.Finding
}
Rule evaluates a recorded run and returns zero or more findings. Rules never touch Docker; they reason only over RunContext.
type RunContext ¶
type RunContext struct {
// contains filtered or unexported fields
}
RunContext is a read-only view over a recorded model.Run for diagnosis rules.
func NewRunContext ¶
func NewRunContext(run *model.Run) *RunContext
NewRunContext wraps run for rule evaluation. run may be nil (empty context).
func (*RunContext) EffectiveConfig ¶
func (c *RunContext) EffectiveConfig() *model.EffectiveConfig
EffectiveConfig returns the run's effective config, if any.
func (*RunContext) Events ¶
func (c *RunContext) Events() []model.Event
Events returns all events on the run.
func (*RunContext) EventsForService ¶
func (c *RunContext) EventsForService(name string) []model.Event
EventsForService returns events whose Service field matches name.
func (*RunContext) Invocation ¶
func (c *RunContext) Invocation() *model.Invocation
Invocation returns the run's invocation context, if any.
func (*RunContext) Run ¶
func (c *RunContext) Run() *model.Run
Run returns the underlying run (may be nil).
func (*RunContext) Service ¶
func (c *RunContext) Service(name string) *model.Service
Service returns the first service with the given name, or nil.
func (*RunContext) Services ¶
func (c *RunContext) Services() []*model.Service
Services returns services sorted stably (project, name).
func (*RunContext) SetCausalPriority ¶
func (c *RunContext) SetCausalPriority(priority map[string]int)
SetCausalPriority sets per-service causal ranks used when sorting findings. Lower values surface first. Services absent from the map sort after ranked ones.