core: simplify dao creation with newDao()

This commit is contained in:
Roman Khimov 2019-12-12 21:04:55 +03:00
parent 32ac01130d
commit c5ed3b788b
4 changed files with 35 additions and 31 deletions

View file

@ -19,6 +19,10 @@ type dao struct {
store *storage.MemCachedStore
}
func newDao(backend storage.Store) *dao {
return &dao{store: storage.NewMemCachedStore(backend)}
}
// GetAndDecode performs get operation and decoding with serializable structures.
func (dao *dao) GetAndDecode(entity io.Serializable, key []byte) error {
entityBytes, err := dao.store.Get(key)