lua-resty-ceph

基于 OpenResty 的一个简单的 Ceph Lua 封装,支持 S3 和 Swift。

$ opm get linsir/lua-resty-ceph

lua-resty-ceph

基于 OpenResty 的一个简单的 Ceph Lua 封装,支持 S3 和 Swift。

更多

  1. <http://docs.ceph.org.cn/radosgw/s3/>

  2. <http://docs.ceph.org.cn/radosgw/swift/>

API

摘要

    local cephs3 = require("resty.ceph.s3")
    local app = cephs3:new(config.access_key, config.secret_key, config.host)
    
    local data = app:create_bucket(bucket)
    ngx.say(data)
    app:get_all_objs(bucket)
        

用法

新建

    local app = cephs3:new(access_key, secret_key, host)

获取所有 Bucket

    app:get_all_buckets()

创建 Bucket

    app:create_bucket(bucket, acl)

删除 Bucket

    app:del_bucket(bucket)

获取所有 Bucket

    app:get_all_buckets()

获取所有对象

    app:get_all_objs(bucket)
    app:get_all_objs(bucket, 'marker=3&max-keys=25')

获取 Bucket 位置

    app:get_buckets_location(bucket)

get_buckets_acl(bucket)

    app:get_buckets_acl(bucket)

创建对象

    app:create_obj(bucket, file, content)

删除对象

    app:del_obj(bucket, file)

获取对象

    app:get_obj(bucket, file)

检查是否存在

    app:check_for_existance(bucket, file)

获取对象 ACL

    app:get_obj_acl(bucket, file)

设置对象 ACL

    app:set_obj_acl(bucket, file)

待办事项

  • 上传操作。

  • 基于 **Lua-rados** <https://github.com/noahdesu/lua-rados> 的简单封装。

作者

Linsir: <https://github.com/linsir>

许可证

BSD 许可证。

保留所有权利。

作者

linsir

许可证

mit

依赖

版本