Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CapturedResponse ¶
type CapturedResponse struct {
URL string `json:"url"`
StatusCode int `json:"status_code"`
Headers map[string][]string `json:"headers"`
Body string `json:"body"`
ContentLen int `json:"content_len"`
WordCount int `json:"word_count"`
LineCount int `json:"line_count"`
FetchedAt time.Time `json:"fetched_at"`
FetchError string `json:"fetch_error,omitempty"`
}
CapturedResponse represents a full HTTP response capture for testing
type Dataset ¶
type Dataset struct {
Name string
Description string
Responses []CapturedResponse
Stats DatasetStats
}
Dataset represents a collection of responses for a specific test scenario
func LoadDataset ¶
LoadDataset loads a gzipped JSON test dataset Results are cached for performance
func (*Dataset) FilterByContentLenRange ¶
func (d *Dataset) FilterByContentLenRange(minLen, maxLen int) []CapturedResponse
FilterByContentLenRange returns responses within the specified content length range
func (*Dataset) FilterByStatus ¶
func (d *Dataset) FilterByStatus(statusCode int) []CapturedResponse
FilterByStatus returns only responses with the specified status code
func (*Dataset) FilterSuccessful ¶
func (d *Dataset) FilterSuccessful() []CapturedResponse
FilterSuccessful returns only responses that were successfully fetched
func (*Dataset) Top ¶
func (d *Dataset) Top(n int) []CapturedResponse
Top returns the top N responses sorted by content length
type DatasetStats ¶
type DatasetStats struct {
TotalResponses int
SuccessfulFetches int
FailedFetches int
UniqueStatuses map[int]int
MinContentLen int
MaxContentLen int
AvgContentLen float64
}
DatasetStats provides summary statistics about a dataset
type ResponseData ¶
ConvertToResponses converts CapturedResponse slice to a slice that can be converted to anomaly.Response Returns raw data that caller can pass to anomaly.NewResponse()
func ExtractResponseData ¶
func ExtractResponseData(captured []CapturedResponse) []ResponseData
ExtractResponseData converts CapturedResponse slice to ResponseData slice