qinium 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qinium/config.rb +4 -0
- data/lib/qinium/host_manager.rb +5 -0
- data/lib/qinium/object.rb +6 -0
- data/lib/qinium/version.rb +1 -1
- 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: 548c73431631f012020ed8e4c94c83017bfdec9454d26b009549f04d8a5204a9
|
4
|
+
data.tar.gz: 1c45033d1fd635870afe11150b871c471898a52c234f8b8c99c9462298d2024d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf283cf247ef4fbe2482370f844bbeb50a09f06e82920bfdd1646aca372438b1c6d53820063f39ef80f9f6cf8bc2550907dab667e1675ec8e38f3739ba6fa06a
|
7
|
+
data.tar.gz: 971575d161e4fbf23253b8b380115321b671a8740c5f54ec283e8c71dd7bbac9d380d1657e4e94386c239aba4228183bcf6663b38888d9f6c3bfb5f45c25e2da
|
data/lib/qinium/config.rb
CHANGED
@@ -14,6 +14,10 @@ class Qinium
|
|
14
14
|
HostManager.new(self).up_host(bucket)
|
15
15
|
end
|
16
16
|
|
17
|
+
def fetch_host(bucket = self.bucket, opts = {})
|
18
|
+
self[:fetch_host] || HostManager.new(self).fetch_host(bucket, opts)
|
19
|
+
end
|
20
|
+
|
17
21
|
def put_policy_options
|
18
22
|
@put_policy_options ||= self[:put_policy_options] || Configurable.new
|
19
23
|
end
|
data/lib/qinium/host_manager.rb
CHANGED
@@ -59,6 +59,11 @@ class Qinium
|
|
59
59
|
hosts[extract_protocol(opts)]["up"]
|
60
60
|
end
|
61
61
|
|
62
|
+
def fetch_host(bucket, opts = {})
|
63
|
+
hosts = hosts(bucket)
|
64
|
+
hosts[extract_protocol(opts)]["io"][0]
|
65
|
+
end
|
66
|
+
|
62
67
|
def hosts(bucket)
|
63
68
|
raise Error, "access_key is missing" if Utils.blank?(access_key)
|
64
69
|
raise Error, "bucket is missing" if Utils.blank?(bucket)
|
data/lib/qinium/object.rb
CHANGED
@@ -41,6 +41,12 @@ class Qinium
|
|
41
41
|
))
|
42
42
|
end
|
43
43
|
|
44
|
+
def fetch(target_url, key, bucket: self.bucket)
|
45
|
+
client.management_post(config.fetch_host(bucket) + '/fetch/' + urlsafe_base64_encode(target_url) + '/to/' + Utils.encode_entry_uri(
|
46
|
+
bucket, key
|
47
|
+
))
|
48
|
+
end
|
49
|
+
|
44
50
|
def list(bucket: self.bucket, marker: "", limit: 1000, prefix: "", delimiter: "")
|
45
51
|
query_string = to_query_string(bucket: bucket, marker: marker, limit: limit, prefix: prefix,
|
46
52
|
delimiter: delimiter)
|
data/lib/qinium/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qinium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xiaohui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Qiniu Cloud Storage SDK for multi-tenant system, can call API with multiple
|
14
14
|
accounts
|