hunt-cache 0.6.3
D language universal object cache library. include memory、redis、memcached
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Hunt Cache
D language universal cache library.
Support drivers
- memory
- redis
- libmemcached
# Versions
- WITHHUNTCACHE
- WITHHUNTREDIS
- WITHHUNTMEMCACHE
- WITHHUNTROCKSDB
Tips
Default using memory and redis drivers.
Sample code
struct Student
{
ulong ID;
string name;
string address;
}
class Grade
{
int gradeLevel;
string gradeName;
Student[] arrStu;
}
auto cache = UCache.CreateUCache();
//string
cache.put("test" , "test");
string val = cache.get("test");
//student.
Student stu1;
stu1.ID = 1;
stu1.name = "tom";
stu1.address = "Tianlin Road 1016";
cache.put("tom" , stu1);
auto stu = cache.get!Student("tom");
//Grade
Grade grade = new Grade();
grade.gradeLevel = 12;
grade.gradeName = "13";
grade.arrStu ~= stu1;
cache.put("13" , grade);
auto grade1 = cache.get!Grade("13");
- Registered by zoujiaqing
- 0.6.3 released 4 years ago
- huntlabs/hunt-cache
- www.huntlabs.net
- Apache-2.0
- Copyright (C) 2015-2019, HuntLabs
- Dependencies:
- hunt
- Versions:
-
0.10.1 2021-Nov-16 0.10.0 2021-Oct-29 0.9.1 2021-May-27 0.9.0 2021-Jan-27 0.8.3 2021-Nov-15 - Download Stats:
-
-
1 downloads today
-
22 downloads this week
-
48 downloads this month
-
2911 downloads total
-
- Score:
- 1.4
- Short URL:
- hunt-cache.dub.pm