🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
No need to expose implementations
Deluan6092076fad39
diff --git a/repositories/index_repository.go b/repositories/index_repository.goindex ea378b479..26e3fff01 100644--- a/repositories/index_repository.go+++ b/repositories/index_repository.go@@ -11,30 +11,30 @@ type ArtistIndex interface {GetAll() ([]models.ArtistIndex, error)}-type ArtistIndexImpl struct {+type artistIndex struct {BaseRepository}func NewArtistIndexRepository() ArtistIndex {- r := &ArtistIndexImpl{}+ r := &artistIndex{}r.init("index", &models.ArtistIndex{})return r}-func (r *ArtistIndexImpl) Put(m *models.ArtistIndex) error {+func (r *artistIndex) Put(m *models.ArtistIndex) error {if m.Id == "" {return errors.New("Id is not set")}return r.saveOrUpdate(m.Id, m)}-func (r *ArtistIndexImpl) Get(id string) (*models.ArtistIndex, error) {+func (r *artistIndex) Get(id string) (*models.ArtistIndex, error) {var rec interface{}rec, err := r.readEntity(id)return rec.(*models.ArtistIndex), err}-func (r *ArtistIndexImpl) GetAll() ([]models.ArtistIndex, error) {+func (r *artistIndex) GetAll() ([]models.ArtistIndex, error) {var indices = make([]models.ArtistIndex, 0)err := r.loadAll(&indices)return indices, errdiff --git a/repositories/property_repository.go b/repositories/property_repository.goindex 7578afa35..02839d904 100644--- a/repositories/property_repository.go+++ b/repositories/property_repository.go@@ -11,17 +11,17 @@ type Property interface {DefaultGet(id string, defaultValue string) (string, error)}-type PropertyImpl struct {+type property struct {BaseRepository}-func NewPropertyRepository() *PropertyImpl {- r := &PropertyImpl{}+func NewPropertyRepository() *property {+ r := &property{}r.init("property", &models.Property{})return r}-func (r *PropertyImpl) Put(id string, value string) error {+func (r *property) Put(id string, value string) error {m := &models.Property{Id: id, Value: value}if m.Id == "" {return errors.New("Id is required")@@ -29,13 +29,13 @@ func (r *PropertyImpl) Put(id string, value string) error {return r.saveOrUpdate(m.Id, m)}-func (r *PropertyImpl) Get(id string) (string, error) {+func (r *property) Get(id string) (string, error) {var rec interface{}rec, err := r.readEntity(id)return rec.(*models.Property).Value, err}-func (r* PropertyImpl) DefaultGet(id string, defaultValue string) (string, error) {+func (r*property) DefaultGet(id string, defaultValue string) (string, error) {v, err := r.Get(id)if v == "" {diff --git a/tests/mocks/mock_index_repo_tests.go b/tests/mocks/mock_index_repo_tests.goindex 4256205ee..2a8d67f8d 100644--- a/tests/mocks/mock_index_repo_tests.go+++ b/tests/mocks/mock_index_repo_tests.go@@ -13,7 +13,7 @@ func CreateMockArtistIndexRepo() *MockArtistIndex {}type MockArtistIndex struct {- repositories.ArtistIndexImpl+ repositories.ArtistIndexdata []models.ArtistIndexerr bool}diff --git a/tests/mocks/mock_property_repo_tests.go b/tests/mocks/mock_property_repo_tests.goindex 72fadb101..f11af9d7f 100644--- a/tests/mocks/mock_property_repo_tests.go+++ b/tests/mocks/mock_property_repo_tests.go@@ -10,7 +10,7 @@ func CreateMockPropertyRepo() *MockProperty {}type MockProperty struct {- repositories.PropertyImpl+ repositories.Propertydata map[string]stringerr bool}