Start refactoring
This commit is contained in:
40
data/repository/game/game.go
Normal file
40
data/repository/game/game.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/google/uuid"
|
||||
"opensavecloudserver/data/repository/user"
|
||||
"time"
|
||||
)
|
||||
|
||||
type (
|
||||
GameRepository interface {
|
||||
GameMetadataByID(ID ID) (GameMetadata, error)
|
||||
CreateGameEntry(game NewGameEntry) (GameMetadata, error)
|
||||
GameSavesHistory(gameID ID) ([]GameSaveVersion, error)
|
||||
UserGamesByUserID(userID user.ID) ([]GameMetadata, error)
|
||||
}
|
||||
|
||||
GameMetadata interface {
|
||||
ID() uuid.UUID
|
||||
Name() string
|
||||
Path() string
|
||||
Revision() string
|
||||
}
|
||||
|
||||
GameSaveVersion interface {
|
||||
ID() string
|
||||
Date() time.Time
|
||||
}
|
||||
|
||||
NewGameEntry interface {
|
||||
Path() string
|
||||
Name() string
|
||||
}
|
||||
|
||||
ID uuid.UUID
|
||||
)
|
||||
|
||||
var (
|
||||
ErrGameNotFound = errors.New("game not found")
|
||||
)
|
||||
Reference in New Issue
Block a user