forked from mtusi2026/mtusi2026lab2
ЛР 2: PostgreSQL, сессии в Valkey, кэш истории (трек 1)
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitflic.ru/project/relationskatie/mtusi2026lab1-ashchkl/internal/domain"
|
||||
)
|
||||
|
||||
|
||||
type UserStore interface {
|
||||
CreateUser(ctx context.Context, username, displayName, passwordHash string) (domain.User, error)
|
||||
UserByID(ctx context.Context, id string) (domain.User, error)
|
||||
CredentialsByUsername(ctx context.Context, username string) (domain.User, string, error)
|
||||
UsernameExists(ctx context.Context, username string) bool
|
||||
}
|
||||
|
||||
type ChatStore interface {
|
||||
CreateChat(ctx context.Context, callerID, title string, memberIDs []string) (domain.Chat, error)
|
||||
ChatByID(ctx context.Context, callerID, chatID string) (domain.Chat, error)
|
||||
ListChats(ctx context.Context, callerID, cursor string, limit int) (domain.Page[domain.Chat], error)
|
||||
}
|
||||
|
||||
type MessageStore interface {
|
||||
AddMessage(ctx context.Context, callerID, chatID, text string) (domain.Message, error)
|
||||
ListMessages(ctx context.Context, callerID, chatID, cursor string, limit int) (domain.Page[domain.Message], error)
|
||||
}
|
||||
|
||||
type Store interface {
|
||||
UserStore
|
||||
ChatStore
|
||||
MessageStore
|
||||
}
|
||||
Reference in New Issue
Block a user