funnel_http 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.golangci.yml +26 -13
- data/CHANGELOG.md +9 -2
- data/README.md +8 -8
- data/ext/funnel_http/funnel_http.go +1 -0
- data/ext/funnel_http/go.mod +2 -2
- data/ext/funnel_http/go.sum +6 -6
- data/ext/funnel_http/run_requests.go +2 -0
- data/lib/funnel_http/client.rb +1 -0
- data/lib/funnel_http/version.rb +1 -1
- data/rbs_collection.lock.yaml +5 -5
- data/sig/funnel_http.rbs +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5daab559328b4688ea1b0df8f729922d5fb0a59c9bf9a59b6b8ad5151f9011e
|
4
|
+
data.tar.gz: e97215f71aeb86c5b3d5c728c573fcb5b0f2a4e3a1f3c86f60f8d76799122177
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3b2dad1cd53e30867557448964cfb08f980cbe2fb10c6545cacf71776b4e5e9c5c1230d8975e470c7fb526ea2383fe67e62235aa8174e12360c692806fbaea9
|
7
|
+
data.tar.gz: eee89453a2d1aa51e9f6e1e44510abf941a0e914b8f9972c92b9495a7756ad4661206cd5ddebb224bcf9e194e9cd0552ac48f47d91af7ac42e688d4281f84899
|
data/.golangci.yml
CHANGED
@@ -1,18 +1,31 @@
|
|
1
|
-
|
2
|
-
revive:
|
3
|
-
rules:
|
4
|
-
- name: exported
|
5
|
-
arguments:
|
6
|
-
- disableStutteringCheck
|
7
|
-
|
1
|
+
version: "2"
|
8
2
|
linters:
|
9
3
|
enable:
|
10
|
-
- gofmt
|
11
4
|
- revive
|
12
5
|
- testifylint
|
13
6
|
- wrapcheck
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
7
|
+
settings:
|
8
|
+
revive:
|
9
|
+
rules:
|
10
|
+
- name: exported
|
11
|
+
arguments:
|
12
|
+
- disableStutteringCheck
|
13
|
+
exclusions:
|
14
|
+
generated: lax
|
15
|
+
presets:
|
16
|
+
- common-false-positives
|
17
|
+
- legacy
|
18
|
+
- std-error-handling
|
19
|
+
paths:
|
20
|
+
- third_party$
|
21
|
+
- builtin$
|
22
|
+
- examples$
|
23
|
+
formatters:
|
24
|
+
enable:
|
25
|
+
- gofmt
|
26
|
+
exclusions:
|
27
|
+
generated: lax
|
28
|
+
paths:
|
29
|
+
- third_party$
|
30
|
+
- builtin$
|
31
|
+
- examples$
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
## [Unreleased]
|
2
|
-
[full changelog](http://github.com/sue445/funnel_http/compare/v0.
|
2
|
+
[full changelog](http://github.com/sue445/funnel_http/compare/v0.4.0...main)
|
3
3
|
|
4
|
-
## [0.
|
4
|
+
## [0.4.0](https://github.com/sue445/funnel_http/releases/tag/v0.4.0) - 2025-04-13
|
5
|
+
[full changelog](http://github.com/sue445/funnel_http/compare/v0.3.2...v0.4.0)
|
6
|
+
|
7
|
+
* Add request url to response
|
8
|
+
* https://github.com/sue445/funnel_http/pull/80
|
9
|
+
* Update Go dependencies
|
10
|
+
|
11
|
+
## [0.3.2](https://github.com/sue445/funnel_http/releases/tag/v0.3.2) - 2025-03-22
|
5
12
|
[full changelog](http://github.com/sue445/funnel_http/compare/v0.3.1...v0.3.2)
|
6
13
|
|
7
14
|
* Fix `Ruby::BlockBodyTypeMismatch` in rbs
|
data/README.md
CHANGED
@@ -33,13 +33,13 @@ client = FunnelHttp::Client.new
|
|
33
33
|
requests = [
|
34
34
|
{
|
35
35
|
method: :get,
|
36
|
-
|
36
|
+
url: "https://example.com/api/user/1",
|
37
37
|
},
|
38
38
|
|
39
39
|
# with request header
|
40
|
-
{
|
41
|
-
method: :get,
|
42
|
-
|
40
|
+
{
|
41
|
+
method: :get,
|
42
|
+
url: "https://example.com/api/user/2",
|
43
43
|
header: {
|
44
44
|
"Authorization" => "Bearer xxxxxxxx",
|
45
45
|
"X-Multiple-Values" => ["1st value", "2nd value"],
|
@@ -49,7 +49,7 @@ requests = [
|
|
49
49
|
# with request body
|
50
50
|
{
|
51
51
|
method: :post,
|
52
|
-
|
52
|
+
url: "https://example.com/api/user",
|
53
53
|
header: {
|
54
54
|
"Authorization" => "Bearer xxxxxxxx",
|
55
55
|
"Content-Type" => "application/json",
|
@@ -60,9 +60,9 @@ requests = [
|
|
60
60
|
|
61
61
|
responses = client.perform(requests)
|
62
62
|
# => [
|
63
|
-
# { status_code: 200, body: "Response of /api/user/1", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
|
64
|
-
# { status_code: 200, body: "Response of /api/user/2", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
|
65
|
-
# { status_code: 200, body: "Response of /api/user", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
|
63
|
+
# { url: "https://example.com/api/user/1", status_code: 200, body: "Response of /api/user/1", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
|
64
|
+
# { url: "https://example.com/api/user/2", status_code: 200, body: "Response of /api/user/2", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
|
65
|
+
# { url: "https://example.com/api/user", status_code: 200, body: "Response of /api/user", header: { "Content-Type" => ["text/plain;charset=utf-8"]} }
|
66
66
|
# ]
|
67
67
|
```
|
68
68
|
|
@@ -44,6 +44,7 @@ func rb_funnel_http_run_requests(self C.VALUE, rbAry C.VALUE) C.VALUE {
|
|
44
44
|
|
45
45
|
ruby.RbHashAset(rbHash, ruby.RbId2Sym(ruby.RbIntern("status_code")), ruby.INT2NUM(response.StatusCode))
|
46
46
|
ruby.RbHashAset(rbHash, ruby.RbId2Sym(ruby.RbIntern("body")), ruby.String2Value(string(response.Body)))
|
47
|
+
ruby.RbHashAset(rbHash, ruby.RbId2Sym(ruby.RbIntern("url")), ruby.String2Value(string(response.URL)))
|
47
48
|
|
48
49
|
rbHashHeader := ruby.RbHashNew()
|
49
50
|
ruby.RbGcRegisterAddress(&rbHashHeader)
|
data/ext/funnel_http/go.mod
CHANGED
@@ -6,10 +6,10 @@ toolchain go1.24.0
|
|
6
6
|
|
7
7
|
require (
|
8
8
|
github.com/cockroachdb/errors v1.11.3
|
9
|
-
github.com/jarcoal/httpmock v1.
|
9
|
+
github.com/jarcoal/httpmock v1.4.0
|
10
10
|
github.com/ruby-go-gem/go-gem-wrapper v0.7.2
|
11
11
|
github.com/stretchr/testify v1.10.0
|
12
|
-
golang.org/x/sync v0.
|
12
|
+
golang.org/x/sync v0.13.0
|
13
13
|
)
|
14
14
|
|
15
15
|
require (
|
data/ext/funnel_http/go.sum
CHANGED
@@ -15,16 +15,16 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
|
15
15
|
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
16
16
|
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
17
17
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
18
|
-
github.com/jarcoal/httpmock v1.
|
19
|
-
github.com/jarcoal/httpmock v1.
|
18
|
+
github.com/jarcoal/httpmock v1.4.0 h1:BvhqnH0JAYbNudL2GMJKgOHe2CtKlzJ/5rWKyp+hc2k=
|
19
|
+
github.com/jarcoal/httpmock v1.4.0/go.mod h1:ftW1xULwo+j0R0JJkJIIi7UKigZUXCLLanykgjwBXL0=
|
20
20
|
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
21
21
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
22
22
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
23
23
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
24
24
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
25
25
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
26
|
-
github.com/maxatome/go-testdeep v1.
|
27
|
-
github.com/maxatome/go-testdeep v1.
|
26
|
+
github.com/maxatome/go-testdeep v1.14.0 h1:rRlLv1+kI8eOI3OaBXZwb3O7xY3exRzdW5QyX48g9wI=
|
27
|
+
github.com/maxatome/go-testdeep v1.14.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM=
|
28
28
|
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
|
29
29
|
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
|
30
30
|
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
@@ -52,8 +52,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
|
|
52
52
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
53
53
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
54
54
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
55
|
-
golang.org/x/sync v0.
|
56
|
-
golang.org/x/sync v0.
|
55
|
+
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
|
56
|
+
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
57
57
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
58
58
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
59
59
|
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
@@ -18,6 +18,7 @@ type Request struct {
|
|
18
18
|
|
19
19
|
// Response is proxy between CRuby and Go
|
20
20
|
type Response struct {
|
21
|
+
URL string
|
21
22
|
StatusCode int
|
22
23
|
Header map[string][]string
|
23
24
|
Body []byte
|
@@ -58,6 +59,7 @@ func RunRequests(httpClient *http.Client, requests []Request) ([]Response, error
|
|
58
59
|
return errors.WithStack(err)
|
59
60
|
}
|
60
61
|
|
62
|
+
responses[i].URL = request.URL
|
61
63
|
responses[i].Body = buf
|
62
64
|
responses[i].Header = map[string][]string{}
|
63
65
|
|
data/lib/funnel_http/client.rb
CHANGED
@@ -37,6 +37,7 @@ module FunnelHttp
|
|
37
37
|
# @option request :body [String, nil] Request body
|
38
38
|
#
|
39
39
|
# @return [Array<Hash<Symbol => Object>>] `Array` of following `Hash`
|
40
|
+
# @return [String] `:url` Request url
|
40
41
|
# @return [Integer] `:status_code`
|
41
42
|
# @return [String] `:body` Response body
|
42
43
|
# @return [Hash{String => Array<String>}] `:header` Response header
|
data/lib/funnel_http/version.rb
CHANGED
data/rbs_collection.lock.yaml
CHANGED
@@ -6,7 +6,7 @@ gems:
|
|
6
6
|
source:
|
7
7
|
type: git
|
8
8
|
name: ruby/gem_rbs_collection
|
9
|
-
revision:
|
9
|
+
revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
|
10
10
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
11
11
|
repo_dir: gems
|
12
12
|
- name: cgi
|
@@ -18,7 +18,7 @@ gems:
|
|
18
18
|
source:
|
19
19
|
type: git
|
20
20
|
name: ruby/gem_rbs_collection
|
21
|
-
revision:
|
21
|
+
revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
|
22
22
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
23
23
|
repo_dir: gems
|
24
24
|
- name: fileutils
|
@@ -38,7 +38,7 @@ gems:
|
|
38
38
|
source:
|
39
39
|
type: git
|
40
40
|
name: ruby/gem_rbs_collection
|
41
|
-
revision:
|
41
|
+
revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
|
42
42
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
43
43
|
repo_dir: gems
|
44
44
|
- name: rake
|
@@ -46,7 +46,7 @@ gems:
|
|
46
46
|
source:
|
47
47
|
type: git
|
48
48
|
name: ruby/gem_rbs_collection
|
49
|
-
revision:
|
49
|
+
revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
|
50
50
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
51
51
|
repo_dir: gems
|
52
52
|
- name: sinatra
|
@@ -54,7 +54,7 @@ gems:
|
|
54
54
|
source:
|
55
55
|
type: git
|
56
56
|
name: ruby/gem_rbs_collection
|
57
|
-
revision:
|
57
|
+
revision: cefa5dea1094880e2386c6d296c743d10eb0cf9d
|
58
58
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
59
59
|
repo_dir: gems
|
60
60
|
- name: stringio
|
data/sig/funnel_http.rbs
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: funnel_http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-04-13 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: go_gem
|