Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9d7d46

Browse files
committed
hammerOthers and proxyCountry injected to Response object
1 parent 80ff208 commit a9d7d46

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

core/engine.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ func (e *engine) runWorker() {
156156
return
157157
}
158158

159+
res.Others = make(map[interface{}]interface{})
160+
res.Others["hammerOthers"] = e.hammer.Others
161+
res.Others["proxyCountry"] = e.proxyService.GetProxyCountry(p)
159162
e.responseChan <- res
160163
}
161164

core/types/response.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ type Response struct {
3434

3535
ProxyAddr *url.URL
3636
ResponseItems []*ResponseItem
37+
38+
// Dynamic field for extra data needs in response object consumers.
39+
Others map[interface{}]interface{}
3740
}
3841

3942
// ResponseItem is corresponding to ScenarioItem.

0 commit comments

Comments
 (0)