Andrey Ivanov 1974db73ab
All checks were successful
continuous-integration/drone/push Build is passing
initial_code (#1)
Reviewed-on: #1
2023-04-20 14:52:38 +00:00

38 lines
1.0 KiB
Go

package scenario
import "time"
type Object struct {
Params Params `yaml:"params" validate:"required"`
Steps []Step `yaml:"steps" validate:"required,dive"`
}
type Params struct {
Address string `yaml:"address" validate:"required"`
Timeout time.Duration `yaml:"timeout" validate:"required"`
}
type Step struct {
Name string `yaml:"name" validate:"required"`
Query Query `yaml:"query" validate:"required"`
Response Response `yaml:"response" validate:"required"`
}
type Query struct {
Method string `yaml:"method" validate:"required"`
URL string `yaml:"url" validate:"required"`
Headers map[string]string `yaml:"headers"`
Data string `yaml:"data"`
}
type Response struct {
Code int `yaml:"code" validate:"required_without=Body"`
Headers map[string]string `yaml:"headers"`
Body []Sample `yaml:"body" validate:"required_without=Code"`
}
type Sample struct {
Function string `yaml:"function"`
Text string `yaml:"text"`
}