diff options
Diffstat (limited to 'meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua')
-rw-r--r-- | meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua b/meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua index d36f147e..af5e9821 100644 --- a/meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua +++ b/meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua @@ -1,9 +1,18 @@ ---@meta -resty_lrucache_pureffi={} -function resty_lrucache_pureffi.delete(self, key) end -function resty_lrucache_pureffi.new(size, load_factor) end -function resty_lrucache_pureffi.set(self, key, value, ttl) end -function resty_lrucache_pureffi.flush_all(self) end -resty_lrucache_pureffi._VERSION="0.09" -function resty_lrucache_pureffi.get(self, key) end -return resty_lrucache_pureffi
\ No newline at end of file + +---@class resty.lrucache.pureffi : resty.lrucache +local lrucache_pureffi = { + _VERSION = "0.11", +} + +--- Creates a new cache instance. +--- +--- Upon failure, returns nil and a string describing the error. +--- +---@param max_items number specifies the maximal number of items this cache can hold. +---@param load_factor? number designates the "load factor" of the FFI-based hash-table used internally by `resty.lrucache.pureffi`; the default value is 0.5 (i.e. 50%); if the load factor is specified, it will be clamped to the range of [0.1, 1] (i.e. if load factor is greater than 1, it will be saturated to 1; likewise, if load-factor is smaller than 0.1, it will be clamped to 0.1). +---@return resty.lrucache.pureffi? cache +---@return string? error +function lrucache_pureffi.new(max_items, load_factor) end + +return lrucache_pureffi
\ No newline at end of file |