diff options
| author | Shulhan <ms@kilabit.info> | 2022-01-10 12:28:19 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-01-10 12:28:19 +0700 |
| commit | 9fa8b78e8203162a79783a1e6bf9a27962e02ee8 (patch) | |
| tree | d21e463e8c77bbb47ad323130d33389b89454e3b | |
| parent | bbaa1ddeca854814389944f9d57a95a331f7476f (diff) | |
| download | gorankusu-9fa8b78e8203162a79783a1e6bf9a27962e02ee8.tar.xz | |
all: update share and ciigo modules
| -rw-r--r-- | example/example.go | 12 | ||||
| -rw-r--r-- | go.mod | 4 | ||||
| -rw-r--r-- | go.sum | 8 | ||||
| -rw-r--r-- | trunks.go | 8 |
4 files changed, 23 insertions, 9 deletions
diff --git a/example/example.go b/example/example.go index 3800bfc..7dbf4be 100644 --- a/example/example.go +++ b/example/example.go @@ -399,7 +399,11 @@ func (ex *Example) pathExamplePost(epr *libhttp.EndpointRequest) ([]byte, error) func (ex *Example) runExampleGet(req *trunks.RunRequest) (res *trunks.RunResponse, err error) { if req.Target.HttpClient == nil { - req.Target.HttpClient = libhttp.NewClient(req.Target.BaseUrl, nil, true) + httpcOpts := &libhttp.ClientOptions{ + ServerUrl: req.Target.BaseUrl, + AllowInsecure: true, + } + req.Target.HttpClient = libhttp.NewClient(httpcOpts) } res = &trunks.RunResponse{} @@ -486,7 +490,11 @@ func (ex *Example) attackExampleGet(rr *trunks.RunRequest) vegeta.Targeter { func (ex *Example) runExamplePostForm(req *trunks.RunRequest) (res *trunks.RunResponse, err error) { if req.Target.HttpClient == nil { - req.Target.HttpClient = libhttp.NewClient(req.Target.BaseUrl, nil, true) + httpcOpts := &libhttp.ClientOptions{ + ServerUrl: req.Target.BaseUrl, + AllowInsecure: true, + } + req.Target.HttpClient = libhttp.NewClient(httpcOpts) } res = &trunks.RunResponse{} @@ -3,11 +3,11 @@ module git.sr.ht/~shulhan/trunks go 1.16 require ( - git.sr.ht/~shulhan/ciigo v0.7.1-0.20211220103326-55bbd8309fd7 + git.sr.ht/~shulhan/ciigo v0.7.1 github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654 // indirect github.com/influxdata/tdigest v0.0.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/shuLhan/share v0.32.1-0.20211220053556-5748b1b96617 + github.com/shuLhan/share v0.33.0 github.com/tsenart/vegeta/v12 v12.8.4 ) @@ -1,7 +1,7 @@ git.sr.ht/~shulhan/asciidoctor-go v0.1.1 h1:Qxc1t07JGHvL0jHGdDTzaS4CCF9M/7ssmkGE9pONEQs= git.sr.ht/~shulhan/asciidoctor-go v0.1.1/go.mod h1:fKngGZlw91mhM+ASRjw1h9bsN4YqM9eDiwfo9uv/mrk= -git.sr.ht/~shulhan/ciigo v0.7.1-0.20211220103326-55bbd8309fd7 h1:JSRCpVa/C53m035g1QKN4asjiCsi16EnkcBVHMGQiIA= -git.sr.ht/~shulhan/ciigo v0.7.1-0.20211220103326-55bbd8309fd7/go.mod h1:r1NZSMDT1gI3LZ+eTzItr/OieJnjzQMNZS2IDIJbPxA= +git.sr.ht/~shulhan/ciigo v0.7.1 h1:s3mhrJtCU50/EXP5513X6YJoJ1Q5ORmpjZQ65iBXUyM= +git.sr.ht/~shulhan/ciigo v0.7.1/go.mod h1:jVzpgL6cejf5x4NEaZG0iP9Y3lI17DbduIL6EZWPBoM= github.com/alecthomas/jsonschema v0.0.0-20180308105923-f2c93856175a/go.mod h1:qpebaTNSsyUn5rPSJMsfqEtDw71TTggXM6stUDI16HA= github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b h1:AP/Y7sqYicnjGDfD5VcY4CIfh1hRXBUavxrvELjTiOE= github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b/go.mod h1:ac9efd0D1fsDb3EJvhqgXRbFx7bs2wqZ10HQPeU8U/Q= @@ -31,8 +31,8 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/miekg/dns v1.1.17/go.mod h1:WgzbA6oji13JREwiNsRDNfl7jYdPnmz+VEuLrA+/48M= github.com/shuLhan/share v0.32.0/go.mod h1:1E7VQSKC7cbCmAi6izvm2S8jH5Z98a9SSS2IlvmNs/Y= -github.com/shuLhan/share v0.32.1-0.20211220053556-5748b1b96617 h1:XEBBHp5fzgr1XBJLuCb5Rw8wUmIewpvfVEI+G1wDkzg= -github.com/shuLhan/share v0.32.1-0.20211220053556-5748b1b96617/go.mod h1:6YvVpuViRgLm4e+8AIh1izGaWgV5lyuj53H19GKCZzI= +github.com/shuLhan/share v0.33.0 h1:fM/yLmAzqMECP3Gp1lFH/l4zH1UZVCvgn8BLuPI2Dnc= +github.com/shuLhan/share v0.33.0/go.mod h1:6YvVpuViRgLm4e+8AIh1izGaWgV5lyuj53H19GKCZzI= github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25 h1:7z3LSn867ex6VSaahyKadf4WtSsJIgne6A1WLOAGM8A= github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25/go.mod h1:lbP8tGiBjZ5YWIc2fzuRpTaz0b/53vT6PEs3QuAWzuU= github.com/tsenart/go-tsz v0.0.0-20180814232043-cdeb9e1e981e/go.mod h1:SWZznP1z5Ki7hDT2ioqiFKEse8K9tU2OUvaRI0NeGQo= @@ -348,11 +348,17 @@ func (trunks *Trunks) getTargetByResultFilename(name string) (t *Target, ht *Htt func (trunks *Trunks) runHttpTarget(rr *RunRequest) (res *RunResponse, err error) { var ( logp = "runHttpTarget" - httpc = libhttp.NewClient(rr.Target.BaseUrl, nil, true) headers = rr.HttpTarget.Headers.ToHttpHeader() params interface{} ) + httpcOpts := &libhttp.ClientOptions{ + ServerUrl: rr.Target.BaseUrl, + AllowInsecure: true, + } + + httpc := libhttp.NewClient(httpcOpts) + switch rr.HttpTarget.RequestType { case libhttp.RequestTypeJSON: params = rr.HttpTarget.Params.ToJsonObject() |
