Draft: feat login
This commit is contained in:
47
interfaces/database.go
Normal file
47
interfaces/database.go
Normal file
@@ -0,0 +1,47 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user