fluent-plugin-google-cloud-storage-out 0.1.8 → 0.1.9
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcb50463e1971d1bc9be0e1035b0a3c5c34aedb9
|
|
4
|
+
data.tar.gz: 8d84ea36fe3b5c9ffee45c8d0531129619be99dc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43bd34d81942e6b3daceb63c5eabb896f3e21ad186f23957e071dfb75240e8d03d34f2ee0c4b8c8535938d4435c06ac26b9007e93767d9c670f68354de92e408
|
|
7
|
+
data.tar.gz: 847fca150a16970c0e64fb078d57889028ce06431460638f168e59e93df5c96c02af6a7a2163630831142f13d1e89a365066233a3843aa34682bab3e1bc7906d
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "fluent-plugin-google-cloud-storage-out"
|
|
7
|
-
spec.version = "0.1.
|
|
7
|
+
spec.version = "0.1.9"
|
|
8
8
|
spec.authors = ["Hideki Matsuoka"]
|
|
9
9
|
spec.email = ["matsuoka.hide@gmail.com"]
|
|
10
10
|
|
|
@@ -81,17 +81,14 @@ module Fluent
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
83
|
def prepare_client
|
|
84
|
-
|
|
85
|
-
storage = Storage::StorageService.new
|
|
84
|
+
@storage = Storage::StorageService.new
|
|
86
85
|
scopes = [Storage::AUTH_CLOUD_PLATFORM, Storage::AUTH_DEVSTORAGE_FULL_CONTROL]
|
|
87
|
-
storage.authorization = ServiceAccountCredentials.make_creds(
|
|
86
|
+
@storage.authorization = ServiceAccountCredentials.make_creds(
|
|
88
87
|
{
|
|
89
88
|
:json_key_io => File.open(@service_account_json_key_path),
|
|
90
89
|
:scope => scopes
|
|
91
90
|
}
|
|
92
91
|
)
|
|
93
|
-
|
|
94
|
-
@google_api_client = storage
|
|
95
92
|
end
|
|
96
93
|
|
|
97
94
|
def start
|
|
@@ -126,17 +123,12 @@ module Fluent
|
|
|
126
123
|
io = StringIO.new(data)
|
|
127
124
|
end
|
|
128
125
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
@gogle_api_client.insert_object(@bucket_id, upload_source: io, name: path, content_type:mimetype_content_type)
|
|
132
|
-
|
|
126
|
+
@storage.insert_object(@bucket_id, upload_source: io, name: path, content_type:mimetype_content_type)
|
|
133
127
|
end
|
|
134
128
|
|
|
135
129
|
def write(chunk)
|
|
136
130
|
gcs_path = path_format(chunk.key)
|
|
137
|
-
|
|
138
131
|
send(gcs_path, chunk.read)
|
|
139
|
-
|
|
140
132
|
gcs_path
|
|
141
133
|
end
|
|
142
134
|
end
|