Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
hd-community-waf / usr / local / share / lua / 5.1 / resty / rate_limit.lua
Size: Mime:
local _M = { _VERSION = '1.0' }
local ffi = require "ffi"
local ffi_cast = ffi.cast
local ffi_str = ffi.string

ffi.cdef[[
    struct lua_resty_limit_req_rec {
        unsigned long        excess;
        uint64_t             last;  /* time in milliseconds */
        /* integer value, 1 corresponds to 0.001 r/s */
    };
]]


function _M.cast(const_rec_ptr_type, v)
    return ffi_cast(const_rec_ptr_type, v)
end

function _M.new()
    return ffi.new("struct lua_resty_limit_req_rec")
end

function _M.sizeof()
    return ffi.sizeof("struct lua_resty_limit_req_rec")
end

function _M.typeof()
    return ffi.typeof("const struct lua_resty_limit_req_rec*")
end

function _M.tostring(rec_cdata, rec_size)
    return ffi_str(rec_cdata, rec_size)
end

return _M