Documentation
¶
Overview ¶
Package regression_watchdog provides baseline comparison and regression detection for ZAP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIBaseline ¶
type APIBaseline struct {
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
Snapshots map[string]shared.HTTPResponse `json:"snapshots"`
}
APIBaseline represents a stored snapshot of API behavior.
type BaselineStore ¶
type BaselineStore struct {
FalconDir string
}
BaselineStore manages the persistence of API snapshots.
func NewBaselineStore ¶
func NewBaselineStore(falconDir string) *BaselineStore
NewBaselineStore creates a new baseline manager.
func (*BaselineStore) Load ¶
func (s *BaselineStore) Load(name string) (*APIBaseline, error)
Load retrieves a baseline from disk.
func (*BaselineStore) Save ¶
func (s *BaselineStore) Save(b APIBaseline) error
Save persists a baseline to disk.
type DiffEngine ¶
type DiffEngine struct {
// contains filtered or unexported fields
}
DiffEngine compares current API responses against baseline snapshots.
func (*DiffEngine) Check ¶
func (e *DiffEngine) Check(baseline *APIBaseline, filter []string) RegressionResult
Check identifies behavioral changes between live API and the baseline.
type Regression ¶
type Regression struct {
Endpoint string `json:"endpoint"`
ChangeType string `json:"change_type"` // status_code, body_diff, response_time
Description string `json:"description"`
}
Regression represents a detected behavioral change.
type RegressionParams ¶
type RegressionParams struct {
BaseURL string `json:"base_url"` // Current API URL
BaselineName string `json:"baseline_name"` // Name of the snapshot to compare against
Endpoints []string `json:"endpoints,omitempty"` // Specific endpoints to verify
SaveBaseline bool `json:"save_as_baseline,omitempty"` // Whether to update the baseline after check
}
RegressionParams defines parameters for checking regressions.
type RegressionResult ¶
type RegressionResult struct {
BaselineDate string `json:"baseline_date"`
Regressions []Regression `json:"regressions"`
StableCount int `json:"stable_count"`
Summary string `json:"summary"`
}
RegressionResult represents the outcome of the comparison.
type RegressionWatchdogTool ¶
type RegressionWatchdogTool struct {
// contains filtered or unexported fields
}
RegressionWatchdogTool compares current API behavior against a stored baseline.
func NewRegressionWatchdogTool ¶
func NewRegressionWatchdogTool(falconDir string, httpTool *shared.HTTPTool) *RegressionWatchdogTool
NewRegressionWatchdogTool creates a new regression watchdog tool.
func (*RegressionWatchdogTool) Description ¶
func (t *RegressionWatchdogTool) Description() string
func (*RegressionWatchdogTool) Execute ¶
func (t *RegressionWatchdogTool) Execute(args string) (string, error)
func (*RegressionWatchdogTool) Name ¶
func (t *RegressionWatchdogTool) Name() string
func (*RegressionWatchdogTool) Parameters ¶
func (t *RegressionWatchdogTool) Parameters() string