summaryrefslogtreecommitdiff
path: root/meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua
diff options
context:
space:
mode:
authorMichael Martin <flrgh@protonmail.com>2021-12-21 18:07:58 -0800
committerMichael Martin <flrgh@protonmail.com>2021-12-21 18:07:58 -0800
commitc43a93345bc4e8bda4adf5f686f17d4598094d78 (patch)
tree749200fe4cc83b78b5e4b8f7371057326e2dc1e4 /meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua
parent31eb51d77fbe3042878e457b7280eee27ba125bd (diff)
downloadlua-language-server-c43a93345bc4e8bda4adf5f686f17d4598094d78.zip
chore: update resty.lrucache annotations
Diffstat (limited to 'meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua')
-rw-r--r--meta/3rd/OpenResty/library/resty.lrucache.pureffi.lua25
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