Files
apitester/structs.go
Nathan Coad e1a1e5a49d
Some checks failed
continuous-integration/drone/push Build is failing
implement hasKeys check
2024-01-03 11:55:56 +11:00

70 lines
1.4 KiB
Go

package main
type TestDefinitions struct {
Name string `json:"name"`
TestCases []TestCase `json:"testCases"`
BaseUrl string `json:"url"`
CaptureCases []CaptureCase `json:"capture"`
Headers map[string]string
Insecure bool `json:"insecure"`
}
type TestCase struct {
Name string
Path string `json:"path"`
Method string `json:"method"`
Description string `json:"description"`
Expect ExpectOptions `json:"expect"`
Header map[string]string
//Body map[string]string
Body []byte
// Something to store results in
ResultStatusCode int
ResultHeaders map[string][]string
ResultBody string
ResultBodyMap map[string]interface{}
}
type CaptureCase struct {
TestCaseName string
CaptureData CaptureCaseData
}
type CaptureCaseData struct {
Header CaptureHeader `json:"header"`
Body CaptureBody `json:"body"`
}
type CaptureHeader struct {
Data map[string]string
}
type CaptureBody struct {
Data map[string]string
}
type CaptureValues struct {
Data map[string]string
}
type ExpectOptions struct {
Header HeaderTests `json:"header"`
Body BodyTests `json:"body"`
}
// Test types
type HeaderTests struct {
Contains map[string]string
Equals map[string]string
}
type BodyTests struct {
Contains map[string]string
Equals map[string]string
HasKeys []string
PathEquals string
PathContains map[string]string
}