multi.go 807 B

123456789101112131415161718192021222324252627282930
  1. package testdata
  2. import (
  3. "context"
  4. )
  5. // mock test
  6. var (
  7. _multiCacheFunc func(c context.Context, keys []int64) (map[int64]*Article, error)
  8. _multiRawFunc func(c context.Context, keys []int64) (map[int64]*Article, error)
  9. _multiAddCacheFunc func(c context.Context, values map[int64]*Article) error
  10. )
  11. // CacheArticles .
  12. func (d *Dao) CacheArticles(c context.Context, keys []int64) (map[int64]*Article, error) {
  13. // get data from cache
  14. return _multiCacheFunc(c, keys)
  15. }
  16. // RawArticles .
  17. func (d *Dao) RawArticles(c context.Context, keys []int64) (map[int64]*Article, error) {
  18. // get data from db
  19. return _multiRawFunc(c, keys)
  20. }
  21. // AddCacheArticles .
  22. func (d *Dao) AddCacheArticles(c context.Context, values map[int64]*Article) error {
  23. // add to cache
  24. return _multiAddCacheFunc(c, values)
  25. }