Introduced CountAll for repositories

This commit is contained in:
Deluan
2016-02-28 02:56:41 -05:00
parent 08f035d99b
commit 280068373f
3 changed files with 19 additions and 7 deletions
+5 -1
View File
@@ -6,7 +6,11 @@ type BaseRepository struct {
func (r *BaseRepository) saveOrUpdate(id string, rec interface{}) error {
return saveStruct(r.key + "_id_" + id, rec)
return saveStruct(r.key, id, rec)
}
func (r *BaseRepository) CountAll() (int, error) {
return count(r.key)
}
func (r *BaseRepository) Dump() {