refactor: IStep interface

This commit is contained in:
debugtalk
2021-09-22 18:41:28 +08:00
parent aee9b0c0b5
commit 9c977c07ef
6 changed files with 41 additions and 19 deletions

View File

@@ -1,5 +1,7 @@
package httpboomer
import "fmt"
// implements IStep interface
type stepRequestExtraction struct {
runner *Runner
@@ -13,12 +15,16 @@ func (s *stepRequestExtraction) WithJmesPath(jmesPath string, varName string) *s
func (s *stepRequestExtraction) Validate() *stepRequestValidation {
return &stepRequestValidation{
TStep: s.step,
step: s.step,
}
}
func (s *stepRequestExtraction) ToStruct() *TStep {
return s.step
func (s *stepRequestExtraction) Name() string {
return s.step.Name
}
func (s *stepRequestExtraction) Type() string {
return fmt.Sprintf("request-%v", s.step.Request.Method)
}
func (s *stepRequestExtraction) Run() error {