Documentation
¶
Index ¶
- func ApplyAuth(req *http.Request, auth *models.AuthConfig)
- func BuildQueryParams(operation *openapi3.Operation) string
- func ExecuteCustomRequest(method, endpoint string, headers map[string]string, body string, ...) (models.TestResult, error)
- func ExecuteCustomRequestCmd(method, endpoint string, headers map[string]string, body string, ...) tea.Cmd
- func FormatJSONBody(body string) (string, error)
- func GenerateRequestBody(operation *openapi3.Operation) ([]byte, error)
- func GenerateSampleFromSchema(schema *openapi3.Schema) interface{}
- func ReplacePlaceholders(path string) string
- func RunTestCmd(specPath, baseURL string, auth *models.AuthConfig, verbose bool, ...) tea.Cmd
- func RunTestParallelCmd(specPath, baseURL string, auth *models.AuthConfig, verbose bool, ...) tea.Cmd
- func RunTestParallelCmdWithSelection(specPath, baseURL string, auth *models.AuthConfig, verbose bool, ...) tea.Cmd
- func RunTests(specPath, baseURL string, auth *models.AuthConfig, verbose bool, ...) ([]models.TestResult, error)
- func RunTestsParallel(specPath, baseURL string, auth *models.AuthConfig, verbose bool, ...) ([]models.TestResult, error)
- func RunTestsParallelWithSelection(specPath, baseURL string, auth *models.AuthConfig, verbose bool, ...) ([]models.TestResult, error)
- func TestEndpoint(method, url string, body []byte, auth *models.AuthConfig, verbose bool) (int, *http.Response, *models.LogEntry, error)
- func TestEndpointWithRetry(method, url string, body []byte, auth *models.AuthConfig, verbose bool, ...) (int, *http.Response, *models.LogEntry, int, error)
- func ValidateJSONBody(body string) error
- type TestCompleteMsg
- type TestErrorMsg
- type TestJob
- type TestProgressMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyAuth ¶
func ApplyAuth(req *http.Request, auth *models.AuthConfig)
applyAuth applies authentication configuration to an HTTP request
func BuildQueryParams ¶
buildQueryParams constructs query parameters from operation parameters
func ExecuteCustomRequest ¶
func ExecuteCustomRequest(method, endpoint string, headers map[string]string, body string, auth *models.AuthConfig, verbose bool) (models.TestResult, error)
ExecuteCustomRequest executes a manually created API request
func ExecuteCustomRequestCmd ¶
func ExecuteCustomRequestCmd(method, endpoint string, headers map[string]string, body string, auth *models.AuthConfig, verbose bool) tea.Cmd
ExecuteCustomRequestCmd wraps ExecuteCustomRequest as a Bubble Tea command
func FormatJSONBody ¶
FormatJSONBody formats a JSON string with indentation
func GenerateRequestBody ¶
generateRequestBody creates a sample JSON request body from an OpenAPI schema Generates realistic sample data based on schema properties, types, and examples
func GenerateSampleFromSchema ¶
generateSampleFromSchema recursively generates sample data from an OpenAPI schema
func ReplacePlaceholders ¶
replacePlaceholders replaces path parameters like {id} with sample values
func RunTestCmd ¶
func RunTestCmd(specPath, baseURL string, auth *models.AuthConfig, verbose bool, maxRetries int, retryDelay int) tea.Cmd
runTestCmd wraps runTests in a Bubble Tea command Returns a message containing test results or error
func RunTestParallelCmd ¶
func RunTestParallelCmd(specPath, baseURL string, auth *models.AuthConfig, verbose bool, maxConcurrency int, maxRetries int, retryDelay int) tea.Cmd
RunTestParallelCmd wraps RunTestsParallel in a Bubble Tea command Uses same interface as RunTestCmd for easy migration
func RunTestParallelCmdWithSelection ¶
func RunTestParallelCmdWithSelection(specPath, baseURL string, auth *models.AuthConfig, verbose bool, maxConcurrency int, maxRetries int, retryDelay int, selectedEndpoints []models.EndpointInfo) tea.Cmd
RunTestParallelCmdWithSelection executes tests for only selected endpoints
func RunTests ¶
func RunTests(specPath, baseURL string, auth *models.AuthConfig, verbose bool, maxRetries int, retryDelay int) ([]models.TestResult, error)
runTests executes API tests against endpoints defined in OpenAPI spec Tests each endpoint with a simple request and records results Accepts optional auth configuration, verbose flag, and retry configuration
func RunTestsParallel ¶
func RunTestsParallel(specPath, baseURL string, auth *models.AuthConfig, verbose bool, maxConcurrency int, maxRetries int, retryDelay int, progressChan chan<- tea.Msg) ([]models.TestResult, error)
RunTestsParallel executes API tests concurrently with a worker pool maxConcurrency: maximum number of concurrent requests (0 = auto-detect)
func RunTestsParallelWithSelection ¶
func RunTestsParallelWithSelection(specPath, baseURL string, auth *models.AuthConfig, verbose bool, maxConcurrency int, maxRetries int, retryDelay int, progressChan chan<- tea.Msg, selectedEndpoints []models.EndpointInfo) ([]models.TestResult, error)
RunTestsParallelWithSelection runs tests for only the selected endpoints
func TestEndpoint ¶
func TestEndpoint(method, url string, body []byte, auth *models.AuthConfig, verbose bool) (int, *http.Response, *models.LogEntry, error)
testEndpoint performs an HTTP request to test an API endpoint Supports GET, POST, PUT, PATCH, DELETE methods with optional request bodies Returns status code, response object, log entry, and error
func TestEndpointWithRetry ¶
func TestEndpointWithRetry( method, url string, body []byte, auth *models.AuthConfig, verbose bool, maxRetries int, retryDelay int, ) (int, *http.Response, *models.LogEntry, int, error)
TestEndpointWithRetry is a wrapper around executeWithRetry that returns the standard TestEndpoint signature plus the retry count for tracking
func ValidateJSONBody ¶
ValidateJSONBody validates that a string is valid JSON
Types ¶
type TestCompleteMsg ¶
type TestCompleteMsg struct {
Results []models.TestResult
}
TestCompleteMsg is sent when testing completes successfully
type TestErrorMsg ¶
type TestErrorMsg struct {
Err error
}
TestErrorMsg is sent when testing encounters an error
type TestJob ¶
type TestJob struct {
Method string
Path string
Endpoint string
RequestBody []byte
Operation *openapi3.Operation
}
TestJob represents a single test to execute
type TestProgressMsg ¶
type TestProgressMsg struct {
Completed int
Total int
Latest *models.TestResult // Most recent result
}
TestProgressMsg is sent during parallel execution to update progress