data-sink-client 0.2.0 → 0.2.1
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/Gemfile.lock +3 -3
- data/lib/data-sink-client/version.rb +1 -1
- data/lib/data_sink/client.rb +7 -6
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '038ce898845f096bc7561080ee847792d1fcf6d4'
|
|
4
|
+
data.tar.gz: 6dde7436089f5283f2acc13952c4f482763fa874
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79e69f46de1930be5e03a2e66876896173f38891865f00aa3b2c2ca2bad5621f3773f57bd428b8e8cc2c51e53838595a6698c7d5a8a836145fda6fb42a155289
|
|
7
|
+
data.tar.gz: 70ae71df3c54fb747575c526711b1b4a289297cf7bd634679fc9a28da5a1f2359c7d8b9a7b3923a3cc958d0efd3bd8b80a2b9d2bfbb3fcbd29e324b5b0bb71ba
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
data-sink-client (0.1
|
|
4
|
+
data-sink-client (0.2.1)
|
|
5
5
|
excon (~> 0.55.0)
|
|
6
6
|
faraday (> 0.10.0)
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@ GEM
|
|
|
14
14
|
safe_yaml (~> 1.0.0)
|
|
15
15
|
diff-lcs (1.3)
|
|
16
16
|
excon (0.55.0)
|
|
17
|
-
faraday (0.
|
|
17
|
+
faraday (0.15.0)
|
|
18
18
|
multipart-post (>= 1.2, < 3)
|
|
19
19
|
hashdiff (0.3.0)
|
|
20
20
|
multipart-post (2.0.0)
|
|
@@ -50,4 +50,4 @@ DEPENDENCIES
|
|
|
50
50
|
webmock (~> 2.1)
|
|
51
51
|
|
|
52
52
|
BUNDLED WITH
|
|
53
|
-
1.
|
|
53
|
+
1.16.1
|
data/lib/data_sink/client.rb
CHANGED
|
@@ -23,21 +23,22 @@ module DataSink
|
|
|
23
23
|
@client = options[:client] || create_client(user, pass)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
def post(stream_id, body)
|
|
27
|
-
post_gzipped(stream_id, gzip(transform(body)))
|
|
26
|
+
def post(stream_id, body, partition_key: nil)
|
|
27
|
+
post_gzipped(stream_id, gzip(transform(body)), partition_key: partition_key)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
def post_gzipped(stream_id, body)
|
|
30
|
+
def post_gzipped(stream_id, body, partition_key: nil)
|
|
31
31
|
client.post do |req|
|
|
32
|
-
req.url endpoint(stream_id)
|
|
32
|
+
req.url endpoint(stream_id, partition_key)
|
|
33
33
|
req.body = body
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
private
|
|
38
38
|
|
|
39
|
-
def endpoint(stream_id)
|
|
40
|
-
[options[:endpoint], stream_id].join('/')
|
|
39
|
+
def endpoint(stream_id, partition_key)
|
|
40
|
+
path = [options[:endpoint], stream_id].join('/')
|
|
41
|
+
partition_key.nil? ? path : "#{path}?partition_key=#{partition_key}"
|
|
41
42
|
end
|
|
42
43
|
|
|
43
44
|
def create_client(user, pass)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: data-sink-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ivan Pirlik
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-05-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
133
133
|
version: '0'
|
|
134
134
|
requirements: []
|
|
135
135
|
rubyforge_project:
|
|
136
|
-
rubygems_version: 2.
|
|
136
|
+
rubygems_version: 2.6.14
|
|
137
137
|
signing_key:
|
|
138
138
|
specification_version: 4
|
|
139
139
|
summary: Client for the data-sink service
|