Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Expectation ¶
type Expectation struct {
Decision string `yaml:"decision"`
Rule string `yaml:"rule,omitempty"`
Message string `yaml:"message,omitempty"`
Mutations []ExpectedMutation `yaml:"mutations,omitempty"`
}
Expectation is the expected evaluation result.
type ExpectedMutation ¶
ExpectedMutation is an expected mutation from a redact action.
type FixtureCall ¶
type FixtureCall struct {
Operation string `yaml:"operation"`
Params map[string]any `yaml:"params"`
Context *FixtureContext `yaml:"context,omitempty"`
}
FixtureCall is the call to evaluate.
type FixtureContext ¶
type FixtureContext struct {
AgentID string `yaml:"agent_id,omitempty"`
UserID string `yaml:"user_id,omitempty"`
Scope string `yaml:"scope,omitempty"`
Direction string `yaml:"direction,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
Timestamp string `yaml:"timestamp,omitempty"` // RFC3339 format
}
FixtureContext is optional context overrides.
type FixtureFile ¶
type FixtureFile struct {
Path string // source file path (set during loading, not in YAML)
Scope string `yaml:"scope"`
Tests []TestCase `yaml:"tests"`
}
FixtureFile is a parsed test fixture file.
func LoadFixtures ¶
func LoadFixtures(path string) ([]FixtureFile, error)
LoadFixtures reads and parses fixture files from a path. Path can be a single .yaml/.yml file or a directory (loads all yaml files).
type TestCase ¶
type TestCase struct {
Name string `yaml:"name"`
Call FixtureCall `yaml:"call"`
Expect Expectation `yaml:"expect"`
}
TestCase is a single test: a call and the expected result.
Click to show internal directories.
Click to hide internal directories.