Skip to content

Instantly share code, notes, and snippets.

@ikbear
Created January 3, 2014 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikbear/8231899 to your computer and use it in GitHub Desktop.
Save ikbear/8231899 to your computer and use it in GitHub Desktop.
File List
# -*- encoding: utf-8 -*-
require "qiniu/conf"
require "qiniu/rpc"
module Qiniu
module Rsf
class Client
def initialize(mac = nil)
@conn = Qiniu::Rpc::ManageClient.new(Qiniu::Conf.settings[:rsf_host], mac)
end
def List(bucket, marker, limit, prefix)
return @conn.call(uri_list(bucket, marker, limit, prefix), nil, nil)
end
private
def uri_list(bucket, marker, limit, prefix)
url = '/list?bucket=' + bucket
url += '&marker=' + marker unless marker.nil?
url += '&limit=' + limit unless limit.nil?
url += '&prefix' + prefix unless prefix.nil?
url
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment