Move models to separate package

This allows easier reuse and better separation of code without introducing
circular dependencies
This commit is contained in:
Philipp Wolfer 2023-11-11 16:20:40 +01:00
parent cdddf89a3e
commit 9d97e324aa
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
8 changed files with 43 additions and 37 deletions

View file

@ -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 {