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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1882ca15da2a4be5ef0fd71015e167d3e5c1803bd8be620aebf092407604fc14
4
- data.tar.gz: 5ba5f38fdde0eeede9f67cad0405b5cf4cc92a5d457b45c73194e3c569369869
3
+ metadata.gz: 548c73431631f012020ed8e4c94c83017bfdec9454d26b009549f04d8a5204a9
4
+ data.tar.gz: 1c45033d1fd635870afe11150b871c471898a52c234f8b8c99c9462298d2024d
5
5
  SHA512:
6
- metadata.gz: eab9765b2a129823cdf304e3848b6137119bc04b866fa2dd3a3269ba28659d3d8e47ff9bde86488defe2fc2f5b719d18ef71429cd8af3c88f58774802bf40e98
7
- data.tar.gz: f74c6321970f164702754a4ba9a512898c83da2528824d487644c5536aebbeaa6e010a709d5069beb43814a419fe3035e07e41d1fb5bb921d69bf3b6a3624cd9
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
@@ -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)
@@ -1,3 +1,3 @@
1
1
  class Qinium
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.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-09 00:00:00.000000000 Z
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