Refactoring to a cleaner architecture

This commit is contained in:
Deluan
2016-03-02 09:07:24 -05:00
parent 74478ce6f9
commit 272a499c7e
27 changed files with 120 additions and 120 deletions
+11
View File
@@ -0,0 +1,11 @@
package domain
type Album struct {
Id string
Name string
ArtistId string `parent:"artist"`
CoverArtPath string // TODO http://stackoverflow.com/questions/13795842/linking-itunes-itc2-files-and-ituneslibrary-xml
Year int
Compilation bool
Rating int
}
+6
View File
@@ -0,0 +1,6 @@
package domain
type Artist struct {
Id string
Name string
}
+18
View File
@@ -0,0 +1,18 @@
package domain
type ArtistInfo struct {
ArtistId string
Artist string
}
type ArtistIndex struct {
Id string
Artists []ArtistInfo
}
type ArtistIndexRepository interface {
Put(m *ArtistIndex) error
Get(id string) (*ArtistIndex, error)
GetAll() ([]ArtistIndex, error)
}
+18
View File
@@ -0,0 +1,18 @@
package domain
import (
"time"
)
type MediaFile struct {
Id string
Path string
Title string
Album string
Artist string
AlbumArtist string
AlbumId string `parent:"album"`
Compilation bool
CreatedAt time.Time
UpdatedAt time.Time
}
+7
View File
@@ -0,0 +1,7 @@
package domain
type MediaFolder struct {
Id string
Name string
Path string
}
+13
View File
@@ -0,0 +1,13 @@
package domain
type Property struct {
Id string
Value string
}
type PropertyRepository interface {
Put(id string, value string) error
Get(id string) (string, error)
DefaultGet(id string, defaultValue string) (string, error)
}