fluent-plugin-gcloud-storage 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d305c8f71fafe1ec78eab6aca3abd92f210b9bc
4
- data.tar.gz: 8be97348873b53a49ca2248418ff5141d9d4cd35
3
+ metadata.gz: 638618564a30823e48d6bb5aa5b44e62c0c07192
4
+ data.tar.gz: 97e1d5601fe81ad6c49de4794904625d7b523aed
5
5
  SHA512:
6
- metadata.gz: 7d6a4049c2aa0f9a1b78f65003459c16243de55320f09ccc0c4a691516cf30569a8ab12f508a3a5b3f4b4f519afb37b674d63f6b6c92c9d4936591ef689ad307
7
- data.tar.gz: 7a6a8f29f5e010ea4a758e03f36346e35971ca8edfa8a57695d17d756ce76202a238ec87ad12edcc69ffba695ab502c781d616a56319dff28706763a3bfc1276
6
+ metadata.gz: 7cefa01237b4bde42120483c66e3bdf915b5c3284390d96fd6b25a137ccb35d2e0d77dff6786b27185c84078cb3b3f5f2157d64631001009cbcc30ef1ca6a89a
7
+ data.tar.gz: 0087ad03b7a15a1be7109c01c91cc20b7c743521331549f5e1faa79d50310b886b33a804dfa4a9c97bd409c372689e2598ec848137b0b14fe04ee4295d2db14f
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'fluent-plugin-gcloud-storage'
5
- spec.version = '0.1.0'
5
+ spec.version = '0.1.2'
6
6
  spec.authors = ['Gergő Sulymosi']
7
7
  spec.email = ['gergo.sulymosi@gmail.com']
8
8
 
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_runtime_dependency 'fluentd', '> 0.10.42'
24
24
  spec.add_runtime_dependency 'gcloud', '~> 0.4.0'
25
+ spec.add_runtime_dependency 'httpclient', '~> 2.6'
25
26
  end
@@ -6,16 +6,17 @@ module Fluent
6
6
  Fluent::Plugin.register_output('gcloud_storage', self)
7
7
 
8
8
  config_set_default :time_slice_format, DEFAULT_TIME_SLICE_FORMAT
9
- config_param :project, :string, :default => nil
10
- config_param :bucket, :string, :default => nil
11
- config_param :key, :string, :default => nil
12
- config_param :path, :string, :default => nil
13
- config_param :format, :string, :default => 'out_file'
9
+ config_param :project, :string, default: nil
10
+ config_param :bucket, :string, default: nil
11
+ config_param :key, :string, default: nil
12
+ config_param :path, :string, default: nil
13
+ config_param :format, :string, default: 'out_file'
14
14
 
15
15
  def initialize
16
16
  super
17
17
 
18
- require 'gcloud'
18
+ require 'gcloud/storage'
19
+ require 'httpclient'
19
20
  end
20
21
 
21
22
  def configure(conf)
@@ -32,10 +33,7 @@ module Fluent
32
33
  def start
33
34
  super
34
35
 
35
- @gs_bucket = Gcloud
36
- .new(@project, @key)
37
- .storage
38
- .bucket(@bucket)
36
+ @gs_bucket = initialize_bucket
39
37
  end
40
38
 
41
39
  # def shutdown; super; end
@@ -58,6 +56,19 @@ module Fluent
58
56
 
59
57
  private
60
58
 
59
+ def initialize_bucket
60
+ # http://googlecloudplatform.github.io/gcloud-ruby/docs/master/Gcloud/Storage/Bucket.html#method-i-create_file-label-A+note+about+large+uploads
61
+ Faraday.default_adapter = :httpclient
62
+ if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('0.9.2')
63
+ Faraday::Response.register_middleware(gzip: Faraday::Response::Middleware)
64
+ end
65
+
66
+ Gcloud
67
+ .new(@project, @key)
68
+ .storage
69
+ .bucket(@bucket)
70
+ end
71
+
61
72
  def generate_path(chunk)
62
73
  path_chunk_id = chunk_unique_id_to_str(chunk.unique_id)
63
74
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-gcloud-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gergő Sulymosi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-19 00:00:00.000000000 Z
11
+ date: 2015-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.4.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: httpclient
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.6'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.6'
97
111
  description: Google Cloud Storage output plugin for fluentd event collector
98
112
  email:
99
113
  - gergo.sulymosi@gmail.com