hunt-cache 0.3.1

D language universal object cache library. include memory、redis、memcached、rocksdb


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:

Build Status

UCache

D language universal cache library.

Support drivers

  • memory
  • redis
  • libmemcached
  • rocksdb

tips

default support memory、redis.

example

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");
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
Show all 22 versions
Download Stats:
  • 2 downloads today

  • 6 downloads this week

  • 46 downloads this month

  • 2932 downloads total

Score:
1.4
Short URL:
hunt-cache.dub.pm