-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
clear_expect_gen.go
60 lines (55 loc) · 1.83 KB
/
clear_expect_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// +build !generate
package hit
import errortrace "github.com/Eun/go-hit/errortrace"
// ⚠️⚠️⚠️ This file was autogenerated by generators/clear/clear ⚠️⚠️⚠️ //
// IClearExpect provides methods to clear steps.
type IClearExpect interface {
IStep
// Body clears all matching Body steps
Body() IClearExpectBody
// Custom clears all matching Custom steps
Custom(value ...Callback) IStep
// Headers clears all matching Headers steps
Headers(value ...string) IClearExpectHeaders
// Status clears all matching Status steps
Status() IClearExpectInt64
// Trailers clears all matching Trailers steps
Trailers(value ...string) IClearExpectHeaders
}
type clearExpect struct {
cp callPath
tr *errortrace.ErrorTrace
}
func newClearExpect(cp callPath) IClearExpect {
return &clearExpect{cp: cp, tr: ett.Prepare()}
}
func (v *clearExpect) trace() *errortrace.ErrorTrace {
return v.tr
}
func (*clearExpect) when() StepTime {
return cleanStep
}
func (v *clearExpect) callPath() callPath {
return v.cp
}
func (v *clearExpect) exec(hit *hitImpl) error {
if err := removeSteps(hit, v.callPath()); err != nil {
return err
}
return nil
}
func (v *clearExpect) Body() IClearExpectBody {
return newClearExpectBody(v.callPath().Push("Body", nil))
}
func (v *clearExpect) Custom(value ...Callback) IStep {
return removeStep(v.callPath().Push("Custom", callbackSliceToInterfaceSlice(value)))
}
func (v *clearExpect) Headers(value ...string) IClearExpectHeaders {
return newClearExpectHeaders(v.callPath().Push("Headers", stringSliceToInterfaceSlice(value)))
}
func (v *clearExpect) Status() IClearExpectInt64 {
return newClearExpectInt64(v.callPath().Push("Status", nil))
}
func (v *clearExpect) Trailers(value ...string) IClearExpectHeaders {
return newClearExpectHeaders(v.callPath().Push("Trailers", stringSliceToInterfaceSlice(value)))
}