2016-02-26 07:32:31 +01:00
|
|
|
package repositories
|
|
|
|
|
|
|
|
type BaseRepository struct {
|
2016-02-28 06:55:36 +01:00
|
|
|
key string
|
2016-02-26 07:32:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-02-28 06:55:36 +01:00
|
|
|
func (r *BaseRepository) saveOrUpdate(id string, rec interface{}) error {
|
2016-02-28 08:56:41 +01:00
|
|
|
return saveStruct(r.key, id, rec)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *BaseRepository) CountAll() (int, error) {
|
|
|
|
return count(r.key)
|
2016-02-26 07:32:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *BaseRepository) Dump() {
|
|
|
|
}
|
|
|
|
|
|
|
|
|