split code into multiple files
This commit is contained in:
68
structs.go
Normal file
68
structs.go
Normal file
@@ -0,0 +1,68 @@
|
||||
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
|
||||
}
|
||||
|
||||
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 map[string]string
|
||||
PathEquals string
|
||||
PathContains map[string]string
|
||||
}
|
Reference in New Issue
Block a user