init HttpBommer 🍰

This commit is contained in:
debugtalk
2021-09-19 13:20:22 +08:00
parent f7bae6ba61
commit 97abc197a4
15 changed files with 561 additions and 1 deletions

25
validate.go Normal file
View File

@@ -0,0 +1,25 @@
package httpboomer
// implements IStep interface
type StepRequestValidation struct {
*TStep
}
func (req *StepRequestValidation) AssertEqual(jmesPath string, expected interface{}, msg string) *StepRequestValidation {
validator := TValidator{
Check: jmesPath,
Comparator: "equals",
Expect: expected,
Message: msg,
}
req.TStep.Validators = append(req.TStep.Validators, validator)
return req
}
func (req *StepRequestValidation) ToStruct() *TStep {
return req.TStep
}
func (req *StepRequestValidation) Run() error {
return req.TStep.Run()
}