hunt-cache 0.2.0

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


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

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");
Authors:
  • zhangyuchun
Dependencies:
hunt
Versions:
0.2.0 2018-Sep-11
0.1.0 2018-Aug-27
~master 2018-Sep-05
~refactor 2018-Sep-11
Show all 4 versions
Download Stats:
  • 13 downloads today

  • 32 downloads this week

  • 76 downloads this month

  • 187 downloads total

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