48 lines
678 B
Go
48 lines
678 B
Go
package interfaces
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.konchin.com/ytshih/inp2025/game/models"
|
|
)
|
|
|
|
type Database interface {
|
|
GetUser(
|
|
ctx context.Context,
|
|
username string,
|
|
) (models.User, error)
|
|
|
|
GetUserStatuses(
|
|
ctx context.Context,
|
|
) ([]models.UserStatus, error)
|
|
|
|
GetRooms(
|
|
ctx context.Context,
|
|
) ([]models.Room, error)
|
|
|
|
InsertUser(
|
|
ctx context.Context,
|
|
user models.User,
|
|
) error
|
|
|
|
InsertUserStatus(
|
|
ctx context.Context,
|
|
userStatus models.UserStatus,
|
|
) error
|
|
|
|
InsertRoom(
|
|
ctx context.Context,
|
|
room models.Room,
|
|
) error
|
|
|
|
DeleteUserStatus(
|
|
ctx context.Context,
|
|
username string,
|
|
) error
|
|
|
|
DeleteRoom(
|
|
ctx context.Context,
|
|
roomId int,
|
|
) error
|
|
}
|