8000 GitHub - lyagusha/lic: ETS cache with TTL, table size limit, table memory limit
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lyagusha/lic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to use it

  1. start app:
    application:start(lic).
  2. init your table:
    lic:new(TabName, Options) -> ok.
    or
    lic:new(TabName) -> ok.
  3. insert data:
    lic:set(TabName, Key, Val) -> ok.
    or
    lic:set(TabName, Key, Val, TTL) -> ok.
  4. get your data:
    lic:get(TabName, Key) -> {ok, Value} | {error, undefined}.
    or
    lic:get(TabName, Key, Def) -> {ok, Value} | {ok, Def}.
  5. you can delete your data:
    lic:delete(TabName, Key) -> ok.

Types:

TabName = atom(),  
Options = [Option],  
Option  = {memory, Mem} | {row_count, Count}    
Mem   = integer(), memory in bytes,  
Count = integer(),  
Key   = term(),  
Val   = term(),  
Def   = term(),  
TTL   = integer(), time in seconds.  

About

ETS cache with TTL, table size limit, table memory limit

Resources

Stars

Watchers

Forks

Packages

No packages published
0