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

@ -26,6 +26,7 @@ import (
"time"
"github.com/spf13/viper"
"go.uploadedlobster.com/scotty/models"
)
type DumpBackend struct{}
@ -34,7 +35,7 @@ func (b DumpBackend) FromConfig(config *viper.Viper) Backend {
return b
}
func (b DumpBackend) ImportListens(listens []Listen, oldestTimestamp time.Time) (ImportResult, error) {
func (b DumpBackend) ImportListens(listens []models.Listen, oldestTimestamp time.Time) (ImportResult, error) {
result := ImportResult{
Count: len(listens),
LastTimestamp: oldestTimestamp,