mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-29 13:27:03 +02:00
Move models to separate package
This allows easier reuse and better separation of code without introducing circular dependencies
This commit is contained in:
parent
cdddf89a3e
commit
9d97e324aa
8 changed files with 43 additions and 37 deletions
|
@ -29,6 +29,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
"go.uploadedlobster.com/scotty/models"
|
||||
)
|
||||
|
||||
type Backend interface {
|
||||
|
@ -36,19 +37,19 @@ type Backend interface {
|
|||
}
|
||||
|
||||
type ListenExport interface {
|
||||
ExportListens(oldestTimestamp time.Time) ([]Listen, error)
|
||||
ExportListens(oldestTimestamp time.Time) ([]models.Listen, error)
|
||||
}
|
||||
|
||||
type ListenImport interface {
|
||||
ImportListens(listens []Listen, oldestTimestamp time.Time) (ImportResult, error)
|
||||
ImportListens(listens []models.Listen, oldestTimestamp time.Time) (ImportResult, error)
|
||||
}
|
||||
|
||||
type LovesExport interface {
|
||||
ExportLoves(oldestTimestamp time.Time) ([]Love, error)
|
||||
ExportLoves(oldestTimestamp time.Time) ([]models.Love, error)
|
||||
}
|
||||
|
||||
type LovesImport interface {
|
||||
ExportLoves(loves []Love, oldestTimestamp time.Time) (ImportResult, error)
|
||||
ExportLoves(loves []models.Love, oldestTimestamp time.Time) (ImportResult, error)
|
||||
}
|
||||
|
||||
type ImportResult struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue