cache: use badgerdb (#15)

This commit is contained in:
l3uddz
2021-02-19 22:20:02 +00:00
committed by GitHub
parent e1945cf714
commit 5b179ed8dc
13 changed files with 175 additions and 77 deletions

17
cache/get_test.go vendored
View File

@@ -38,7 +38,7 @@ func TestClient_Get(t *testing.T) {
wantErr: true,
},
{
name: "with value",
name: "with value ttl",
fields: fields{
log: zerolog.Logger{},
},
@@ -52,25 +52,12 @@ func TestClient_Get(t *testing.T) {
want: []byte("test"),
wantErr: false,
},
{
name: "no value post ttl",
fields: fields{
log: zerolog.Logger{},
},
args: args{
bucket: "get",
key: "test",
},
sleep: 1 * time.Second,
want: nil,
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &Client{
log: tt.fields.log,
db: newDb(t, "get"),
db: newDb(t),
}
if tt.put {