Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBodyExtractor ¶
func NewBodyExtractor() extractor
func NewHTTPValidator ¶
func NewHTTPValidator() validator
NewHTTPValidator instantiates a new HTTPValidator
func NewTemplateInterpolator ¶
func NewTemplateInterpolator() *templateInterpolator
NewTemplateInterpolator instantiates a new template interpolator
Types ¶
type Executor ¶ added in v0.1.6
func NewHTTPExecutor ¶
NewHTTPExecutor instantiates a new http executor
type ExpectBody ¶
type ExpectedResponse ¶
type ExpectedResponse struct { Code *int `yaml:"code" json:"code"` Headers *Headers `yaml:"headers" json:"headers"` Body []*ExpectBody `yaml:"body" json:"body" validate:"expectBody"` }
type Headers ¶
func (*Headers) UnmarshalYAML ¶
UnmarshalYAML unmarshalls yaml in the format
headers: header1: 1 header1: 4 header2: [2,3] header3: 1
into Headers to result in
map{ header1: [1,4], header2: [2,3], header3: [1], }
type PreparedStep ¶
type PreparedStep Step
PreparedStep is the same as step, but with replaced template tokens
type Request ¶
type Request struct { // Type if the method of the request Type string `yaml:"method" json:"method" validate:"required"` Endpoint string `yaml:"endpoint" json:"endpoint" validate:"required"` Headers Headers `yaml:"headers" json:"headers"` Body string `yaml:"body" json:"body"` SkipSSLVerification *bool `yaml:"skip_ssl_verify" json:"skip_ssl_verify"` }
Request is a single step request data
type Result ¶
type Result struct { Step PreparedStep Timings http.Timings Exported Exported Valid ValidationResult }
Result has all the data about the step execution
type Step ¶
type Step struct { ID string `yaml:"id" json:"id" validate:"required"` Variables variables.Variables `yaml:"variables" json:"variables"` Request Request `yaml:"request" json:"request" validate:"required"` Response ExpectedResponse `yaml:"expect" json:"expect"` Export Export `yaml:"export" json:"export"` }
Step is the data for a single endpoint
type ValidationResult ¶
type ValidationResult struct {
Errors map[string]string // a list of error keys and more information about what caused them
}
ValidationResult holds information if the validation succeeded or not and what errors were encountered if any
func (ValidationResult) OK ¶
func (r ValidationResult) OK() bool
OK returns overall check status, true only if every other check passes
Click to show internal directories.
Click to hide internal directories.