Big Refactor:

- Create model.DataStore, with provision for transactions
- Change all layers dependencies on repositories to use DataStore
- Implemented persistence.SQLStore
- Removed iTunes Bridge/Importer support
This commit is contained in:
Deluan
2020-01-19 15:37:41 -05:00
parent 40186f7e10
commit 67eeb218c4
47 changed files with 389 additions and 1621 deletions
+3 -3
View File
@@ -1,6 +1,7 @@
package persistence
import (
"github.com/astaxie/beego/orm"
"github.com/cloudsonic/sonic-server/model"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -10,8 +11,7 @@ var _ = Describe("ChecksumRepository", func() {
var repo model.ChecksumRepository
BeforeEach(func() {
Db().Delete(&checksum{ID: checkSumId})
repo = NewCheckSumRepository()
repo = NewCheckSumRepository(orm.NewOrm())
err := repo.SetData(map[string]string{
"a": "AAA", "b": "BBB",
})
@@ -27,7 +27,7 @@ var _ = Describe("ChecksumRepository", func() {
})
It("persists data", func() {
newRepo := NewCheckSumRepository()
newRepo := NewCheckSumRepository(orm.NewOrm())
sums, err := newRepo.GetData()
Expect(err).To(BeNil())
Expect(sums["b"]).To(Equal("BBB"))