File: list_objects.rb

package info (click to toggle)
ruby-fog-aliyun 0.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 720 kB
  • sloc: ruby: 5,804; makefile: 6; sh: 3
file content (27 lines) | stat: -rw-r--r-- 753 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

module Fog
  module Aliyun
    class Storage
      class Real
        def list_objects(bucket_name, options = {})
          maxKeys = options[:max_keys] || 1000
          maxKeys = maxKeys.to_i
          maxKeys = [maxKeys, 1000].min

          options[:limit] = maxKeys
          options.delete(:max_keys)
          @oss_protocol.list_objects(bucket_name, options)
        end

        def list_multipart_uploads(bucket_name, _options = {})
          @oss_protocol.list_multipart_uploads(bucket_name, _options)
        end

        def list_parts(bucket_name, object_name, upload_id, _options = {})
          @oss_protocol.list_parts(bucket_name, object_name, upload_id, _options)
        end
      end
    end
  end
end