You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionresty_lrucache_pureffi.delete(self, key) end
4
-
functionresty_lrucache_pureffi.new(size, load_factor) end
5
-
functionresty_lrucache_pureffi.set(self, key, value, ttl) end
6
-
functionresty_lrucache_pureffi.flush_all(self) end
7
-
resty_lrucache_pureffi._VERSION="0.09"
8
-
functionresty_lrucache_pureffi.get(self, key) end
9
-
returnresty_lrucache_pureffi
2
+
3
+
---@classresty.lrucache.pureffi:resty.lrucache
4
+
locallrucache_pureffi= {
5
+
_VERSION="0.11",
6
+
}
7
+
8
+
--- Creates a new cache instance.
9
+
---
10
+
--- Upon failure, returns nil and a string describing the error.
11
+
---
12
+
---@parammax_itemsnumber specifies the maximal number of items this cache can hold.
13
+
---@paramload_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).
14
+
---@returnresty.lrucache.pureffi?cache
15
+
---@returnstring?error
16
+
functionlrucache_pureffi.new(max_items, load_factor) end
0 commit comments