Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

30
app/tool/cache/testdata/multi.go vendored Normal file
View File

@@ -0,0 +1,30 @@
package testdata
import (
"context"
)
// mock test
var (
_multiCacheFunc func(c context.Context, keys []int64) (map[int64]*Article, error)
_multiRawFunc func(c context.Context, keys []int64) (map[int64]*Article, error)
_multiAddCacheFunc func(c context.Context, values map[int64]*Article) error
)
// CacheArticles .
func (d *Dao) CacheArticles(c context.Context, keys []int64) (map[int64]*Article, error) {
// get data from cache
return _multiCacheFunc(c, keys)
}
// RawArticles .
func (d *Dao) RawArticles(c context.Context, keys []int64) (map[int64]*Article, error) {
// get data from db
return _multiRawFunc(c, keys)
}
// AddCacheArticles .
func (d *Dao) AddCacheArticles(c context.Context, values map[int64]*Article) error {
// add to cache
return _multiAddCacheFunc(c, values)
}